Part Number Hot Search : 
15SHC05I SS443KUA 300R1 8XC152JD 01456 BYW95 KPC544 E1482S
Product Description
Full Text Search
 

To Download HD6432256 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  revision date: aug 08, 2006 16 h8s/2258, h8s/2239, h8s/2238, h8s/2237, h8s/2227 groups hardware manual renesas 16-bit single-chip microcomputer h8s family/h8s/2200 series h8s/2258 hd64f2258 h8s/2236r hd6432236r hd6432258 hd6432236rw hd6432258w h8s/2237 hd6472237 h8s/2256 HD6432256 hd6432237 HD6432256w h8s/2235 hd6432235 h8s/2239 hd64f2239 h8s/2233 hd6432233 hd6432239 h8s/2227 hd64f2227 hd6432239w hd6432227 h8s/2238b hd64f2238b h8s/2225 hd6432225 hd6432238b h8s/2224 hd6432224 hd6432238bw h8s/2223 hd6432223 h8s/2238r hd64f2238r hd6432238r hd6432238rw h8s/2236b hd6432236b hd6432236bw rev. 5.00 rej09b0054-0500
rev. 5.00 aug 08, 2006 page ii of lx xxvi 1. these materials are intended as a reference to assist our customers in the selection of the renesas technology corp. product best suited to the customer's application; they do not convey any license under any intellectual property rights, or any other rights, belonging to renesas technology corp. or a third party. 2. renesas technology corp. assumes no responsibility for any damage, or infringement of any third- party's rights, originating in the use of any product data, diagrams, charts, programs, algorithms, or circuit application examples contained in these materials. 3. all information contained in these materials, including product data, diagrams, charts, programs and algorithms represents information on products at the time of publication of these materials, and are subject to change by renesas technology corp. without notice due to product improvements or other reasons. it is therefore recommended that customers contact renesas technology corp. or an authorized renesas technology corp. product distributor for the latest product information before purchasing a product listed herein. the information described here may contain technical inaccuracies or typographical errors. renesas technology corp. assumes no responsibility for any damage, liability, or other loss rising from these inaccuracies or errors. please also pay attention to information published by renesas technology corp. by various means, including the renesas technology corp. semiconductor home page (http://www.renesas.com). 4. when using any or all of the information contained in these materials, including product data, diagrams, charts, programs, and algorithms, please be sure to evaluate all information as a total system before making a final decision on the applicability of the information and products. renesas technology corp. assumes no responsibility for any damage, liability or other loss resulting from the information contained herein. 5. renesas technology corp. semiconductors are not designed or manufactured for use in a device or system that is used under circumstances in which human life is potentially at stake. please contact renesas technology corp. or an authorized renesas technology corp. product distributor when considering the use of a product contained herein for any specific purposes, such as apparatus or systems for transportation, vehicular, medical, aerospace, nuclear, or undersea repeater use. 6. the prior written approval of renesas technology corp. is necessary to reprint or reproduce in whole or in part these materials. 7. if these products or technologies are subject to the japanese export control restrictions, they must be exported under a license from the japanese government and cannot be imported into a country other than the approved destination. any diversion or reexport contrary to the export control laws and regulations of japan and/or the country of destination is prohibited. 8. please contact renesas technology corp. for further details on these materials or the products contained therein. 1. renesas technology corp. puts the maximum effort into making semiconductor products better and more reliable, but there is always the possibility that trouble may occur with them. trouble with semiconductors may lead to personal injury, fire or property damage. remember to give due consideration to safety when making your circuit designs, with appropriate measures such as (i) placement of substitutive, auxiliary circuits, (ii) use of nonflammable material or (iii) prevention against any malfunction or mishap. keep safety first in your circuit designs! notes regarding these materials
rev. 5.00 aug 08, 2006 page iii of lx xxvi general precautions on handling of product 1. treatment of nc pins note: do not connect anything to the nc pins. the nc (not connected) pins are either not connected to any of the internal circuitry or are used as test pins or to reduce noise. if something is connected to the nc pins, the operation of the lsi is not guaranteed. 2. treatment of unused input pins note: fix all unused input pins to high or low level. generally, the input pins of cmos products are high-impedance input pins. if unused pins are in their open states, intermediate levels are induced by noise in the vicinity, a pass- through current flows internally, and a malfunction may occur. 3. processing before initialization note: when power is first supplied, the product?s state is undefined. the states of internal circuits are undefined until full power is supplied throughout the chip and a low level is input on the reset pin. during the period where the states are undefined, the register settings and the output state of each pin are also undefined. design your system so that it does not malfunction because of processing while it is in this undefined state. for those products which have a reset function, reset the lsi immediately after the power supply has been turned on. 4. prohibition of access to undefined or reserved addresses note: access to undefined or reserved addresses is prohibited. the undefined or reserved addresses may be used to expand functions, or test registers may have been be allocated to these addresses. do not access these registers; the system?s operation is not guaranteed if they are accessed.
rev. 5.00 aug 08, 2006 page iv of lx xxvi configuration of this manual this manual comprises the following items: 1. general precautions on handling of product 2. configuration of this manual 3. preface 4. main revisions in this edition the list of revisions is a summary of points that have been revised or added to earlier versions. this does not include all of the revised contents. for details, see the actual locations in this manual. 5. contents 6. overview 7. description of functional modules ? cpu and system-control modules ? on-chip peripheral modules the configuration of the functional description of each module differs according to the module. however, the generic style includes the following items: i) feature ii) input/output pin iii) register description iv) operation v) usage note when designing an application system that includes this lsi, take notes into account. each section includes notes in relation to the descriptions given, and usage notes are given, as required, as the final part of each section. 8. list of registers 9. electrical characteristics 10. appendix 11. index
rev. 5.00 aug 08, 2006 page v of lx xxvi preface the h8s/2558 group, h8s/2239 group, h8s/2238 group, h8s/2237 group, and h8s/2227 group are high-performance microcomputers made up of the internal 32-bit configuration h8s/2000 cpu as their cores, and the peripheral functions required to configure a system. a single-power flash memory (f-ztat tm * ) version and masked rom version are available for these lsis? rom. these versions provide flexibility as they can be reprogrammed in no time to cope with all situations from the early stages of mass production to full-scale mass production. this is particularly applicable to application devices of which the specifications frequently changeable. on-chip peripheral functions of each microcomputer are summarized below. note: * f-ztat is a trademark of renesas technology corp.
rev. 5.00 aug 08, 2006 page vi of lx xxvi list of on-chip peripheral functions: group name h8s/2258 group h8s/2239 group h8s/2238 group h8s/2237 group h8s/2227 group microcomputer h8s/2258 h8s/2256 h8s/2239 h8s/2238b h8s/2238r h8s/2236b h8s/2236r h8s/2237 h8s/2235 h8s/2233 h8s/2227 h8s/2225 h8s/2224 h8s/2223 bus controller (bsc) o (16 bits) o (16 bits) o (16 bits) o (16bits) o (16 bits) data transfer controller (dtc) ooooo dma controller (dmac) ? o ??? pc break controller (pbc) 2 2 2 2 2 16-bit timer pulse unit (tpu) 6 6 6 6 3 8-bit timer (tmr) 4 4 4 2 2 watchdog timer (wdt) 2 2 2 2 2 serial communication interface (sci) 4 4 4 4 3 i 2 c bus interface (iic) 2 (option) 2 (option) 2 (option) ?? d/a converter 2 2 2 2 ? a/d converter analog input 8 8 8 8 8 iebus ? * controller (ieb) 1 ???? note: * iebus (inter equipment bus) is a trademark of nec electronics corp. target users: this manual was written for users who will be using the h8s/2258 group, h8s/2239 group, h8s/2238 group, h8s/2237 group, and h8s/2227 group in the design of application systems. target users are expected to understand the fundamentals of electrical circuits, logical circuits, and microcomputers. objective: this manual was written to explain the h8s/2258 group, h8s/2239 group, h8s/2238 group, h8s/2237 group, and h8s/2227 group hardware functions and electrical characteristics of this lsi to the target users. refer to the h8s/2600 series, h8s/2000 series software manual for a detailed description of the instruction set.
rev. 5.00 aug 08, 2006 page vii of lxxxvi notes on reading this manual: ? in order to understand the overall functions of the chip read the manual according to the contents. this manual can be roughly categorized into descriptions on the cpu, system control functions, peripheral functions, and electrical characteristics. ? in order to understand the details of the cpu?s functions read the h8s/2600 series, h8s/2000 series software manual. ? in order to understand the details of a register whole name is already known read the index that is the final part of the manual to find the page number of the entry on the register. the addresses, bits, and initial values of the registers are summarized in section 26, list of registers. rules: register name: the following notation is used for cases when the same or a similar function, e.g., 16-bit timer pulse unit or serial communication, is implemented on more than one channel: xxx_n (xxx is the register name and n is the channel number) bit order: the msb is on the left and the lsb is on the right. number notation: binary is b'xxxx, hexadecimal is h'xxxx, and decimal is xxxx. signal notation: an overbar is added to a low-active signal: xxxx related manuals: the latest versions of all related manuals are available from our web site. please ensure you have the latest versions of all documents. http://www.renesas.com/ h8s/2258 group, h8s/2239 group, h8s/2238 group, h8s/2237 group, h8s/2227 group manuals: document title document no. h8s/2258 group, h8s/2239 group, h8s/2238 group, h8s/2237 group, h8s/2227 group hardware manual this manual h8s/2600 series, h8s/2000 series software manual rej09b0139
rev. 5.00 aug 08, 2006 page viii of lx xxvi user's manuals for development tools: document title document no. h8s, h8/300 series c/c++ compiler, assembler, optimized linkage editor compiler package ver. 6.01 user's manual rej10b0161 h8s, h8/300 series high-performance embedded workshop 3 tutorial rej10b0024 h8s, h8/300 series high-performance embedded workshop 3 user's manual rej10b0026 high-performance embedded workshop v.4.00 user's manual rej10j0886 application notes: document title document no. h8s, h8/300 series c/c++ compiler package application note rej05b0464
rev. 5.00 aug 08, 2006 page ix of l xxxvi main revisions for this edition item page revision (see manual for details) all ? description of "under development" for hd64f2239 deleted 1.1 features 2 ? on-chip memory table amended rom model rom ram remarks hd6432258 256 kbytes 16 kbytes masked rom version hd6432258w 256 kbytes 16 kbytes HD6432256 128 kbytes 8 kbytes HD6432256w 128 kbytes 8 kbytes 3 ? compact package package (code) * 6 tqfp-100 tfp-100b, tfp-100bv tqfp-100 * 1 tfp-100g, tfp-100gv qfp-100 * 2 fp-100a, fp-100av qfp-100 * 3 fp-100b, fp-100bv lfbga-112 * 4 bp-112, bp-112v tfbga-112 * 5 tbp-112a, tbp-112av notes amended notes: 1. not supported by the h8s/2258 group. 2. supported only by the h8s/2258 group, h8s/2238b, h8s/2236b, h8s/2237 group, and hd6432227. 3. not supported by the hd64f2227. 4. supported only by the hd64f2238r. 5. supported only by the hd64f2238r and hd64f2239. 6. package code ending in the letter v designate pb-free product. 1.3.1 pin arrangement figure 1.11 pin arrangement of h8s/2238 group (fp-100a, fp-100av: top view, only for h8s/2238b and h8s/2236b) 14 figure 1.11 title amended
rev. 5.00 aug 08, 2006 page x of l xxxvi item page revision (see manual for details) 1.3.1 pin arrangement figure 1.16 pin arrangement of h8s/2227 group (fp-100a, fp-100av: top view, only for hd6432227) 19 figure 1.16 title amended table 1.3 pin arrangements in each mode of h8s/2238 group 33 notes amended notes: 1. supported only by h8s/ 2238 b and h8s/2236b. 2. supported only by the hd64f2238r. 3. v cc in the h8s/ 2238b and h8s/2236b. 1.3.2 pin arrangement in each mode table 1.5 pin arrangements in each mode of h8s/2227 group 39 to 43 table 1.5 amended fp-100b * 1 fp-100bv * 1 fp-100a * 2 fp-100bav * 2 41 table 1.5 amended pin no. pin name tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b * 1 fp-100bv * 1 fp-100a * 2 fp-100av * 2 mode 4 mode 5 mode 6 mode 7 flash memory programmable mode 57 60 osc2 osc2 osc2 osc2 nc 58 61 osc1 osc1 osc1 osc1 vss 59 62 res res res res res 43 note 2 added notes: 1. supported only by masked rom version. 2. supported only by the hd6432227. 45 table 1.6 amended res * stby * nmi * 1.3.3 pin functions table 1.6 pin functions of h8s/2258 group 49 note: * measures should be taken to deal with noise, which can cause operation errors otherwise. table 1.7 pin functions of h8s/2239 group and h8s/2238 group 50 table 1.7 amended cvcc in power supply ... (h8s/2239, h8s/2378r , and h8s/2236r used), ... 51 table 1.7 amended res * 5 stby * 5 nmi * 5
rev. 5.00 aug 08, 2006 page xi of l xxxvi item page revision (see manual for details) 1.3.3 pin functions table 1.7 pin functions of h8s/2239 group and h8s/2238 group 53 pin no. type symbol tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b fp-100bv fp-100a * 3 fp-100av * 3 bp-112 * 1 bp-112v * 1 tbp-112a * 4 tbp-112av * 4 i/o function dma controller (dmac) * 2 dreq1 dreq0 89 90 tend1 tend0 87 88 dack1 dack0 35 34 55 p47 to p40 in i/o ports l10, l9, k11, k10, k9, k8, h7, j8 56 notes: 1. supported only by the hd64f2238r. 2. supported only by the h8s/2239 group. 3. supported only by the h8s/2238b and h8s/2236b. 4. supported only by the hd64f2238r and hd64f 2239 . 5. measures should be taken to deal with noise, which can cause operation errors otherwise. table 1.8 pin functions of h8s/2237 group and h8s/2227 group 57 to 61 table 1.8 amended fp-100b * 1 fp-100bv * 1 fp-100a * 2 fp-100bav * 2 res * 3 stby * 3 nmi * 3 61 notes amended notes: 1. supported only by masked rom version. 2. supported only by the hd6432227. 3. measures should be taken to deal with noise, which can cause operation errors otherwise. 3.4 memory map in each operating mode figure 3.7 h8s/2235 and h8s/2225 memory map in each operating mode 115 figure 3.7 amended (before) on-chip r am (after) on-chip r om 5.1 features figure 5.1 block diagram of interrupt controller 128 figure 5.1 amended (before) irq (after) i rq 5.3.2 irq enable register (ier) 131 description amended (before) irqn (after) irqn
rev. 5.00 aug 08, 2006 page xii of l xxxvi item page revision (see manual for details) 5.3.4 irq status register (isr) 134 description amended isr indicates the status of irqn (n=7 to 0) interrupt requests. 6.3.4 operation in transition to power-down modes 161, 162 description amended ? when the sleep instruction causes a transition from high-speed (medium-speed) mode to sleep mode , or from subactive mode to subsleep mode: after execution of the sleep instruction, a transition is not made to sleep mode or subsleep mode, and pc break interrupt handling is executed. ... ? when the sleep instruction causes a transition to software standby mode or watch mode: 8.3 register descriptions 205 description amended ? transfer count register_0a (e tcr_0a) ? transfer count register_0b (e tcr_0b) 8.7.1 dmac register access during operation figure 8.38 dmac register update timing 276 figure 8.38 amended dma read dma write dma dead dma last transfer cycle transfer destination nsfer urce idle ead dead write [2'] [3] 9.1 features figure 9.1 block diagram of dtc 282 figure 9.1 amended (before) dtcera to dtcer f, dtceri (after) dtcera to dtcer g, dtceri 9.2 register descriptions 283 description amended ... when activated, ... back to the ram. ? dtc enable registers a to g, and i (dcter a to dtcerg, and dtceri) ...
rev. 5.00 aug 08, 2006 page xiii of lx xxvi item page revision (see manual for details) 9.2.7 dtc enable registers a to g, and i 286, 287 section 9.2.7 description replaced and bit table amended 9.2.7 dtc enable registers a to g, and i (dtcera to dtcerg, and dtceri) dtcer is a set of registers to specify the dtc activation interrupt source, and comprised of eigh t registers; dtcera to dtcerg, and dtceri. the correspondence between interrupt sources and dtce bits, and vector numbers generated by the interrupt controller are shown in table 9.2. for dtce bit setting, use bit manipulation instructions such as bset and bclr for reading and writing. when multiple activation sources are to be set at one time, only at the initial setting, writing data is enabled after executing a dummy read on the relevant register with all the interrupt being masked. bit bit name initial value r/w description 7 6 5 4 3 2 1 0 dtcen7 dtcen6 dtcen5 dtcen4 dtcen3 dtcen2 dtcen1 dtcen0 0 0 0 0 0 0 0 0 r/w r/w r/w r/w r/w r/w r/w r/w dtc activation enable 0: disables an interrupt for dtc activation. 1: specifies a relevant interrupt source as a dtc activation source. [clearing conditions] ? ? 9.2.8 dtc vector register (dtvecr) 288 bit table amended bit bit name initial value r/w description 7swdt e 0 r/w dtc software activation enable enables or disables the dtc software activation. 0: disables the dtc software activation. 1: enables the dtc software activation. [clearing conditions] ? when the disel bit is 0 and the specified number of transfers have not ended ? when 0 is written to the disel bit after a software-activated data transfer end interrupt (swdtend) request has been sent to the cpu. [retaining conditions] ? when the disel bit is 1 and data transfer has ended ? when the specified number of transfers have ended ? when the software-activated data transfer is in process 9.4 location of register information and dtc vector table table 9.2 interrupt sources, dtc vector addresses, and corresponding dtces 293 dtce description of ierxi (rxrdy) and ietxi (txrdy) amended dtc eg6 dtc eg5
rev. 5.00 aug 08, 2006 page xiv of l xxxvi item page revision (see manual for details) 9.8.2 on-chip ram 304 description amended the mra, ... in the on-chip ram. when the dtc is used, the rame bit in syscr should not be cleared to 0. section 10 i/o ports table 10.1 port functions 306 port 3 input/output and output type description amended ... nmos push-pull output * 1 (p35, p34, sck1) 10.2 port 3 315 description amended port 3 is ... following registers. the p34, p35, and sck1 function as nmos push/pull outputs. * 10.2.5 pin functions 317 description amended as shown in figure 10.1, when the pins p35, p34, sck1, sck0 , or sda0 type open drain output is used, ... figure 10.1 types of open drain outputs 318 figure 10.1 amended (a) open drain output type for p34, p35, sck1, scl 0, and sda0 pins 318 description amended (before) ... output the p2 v cc level. (after) ... output the v cc level. 319 table amended ? p35/sck1/scl0/ irq5 sck1 input pin scl 0 i/o pin * 3 ? p34/rxd1/sda0 sda0 i/o pin * 2 320 ? p33/txd1/scl1 scl1 i/o pin * 2 ? p32/sck0/sda0 sda1 i/o pin * 3 10.4.4 pin functions 324 ? p75/tmo3/sck3 description amended ... os3 to os0 bits in tcsr_3 of tmr_3 * , cke1 and ... table amended os3 to os0 * tmo3 * output pin note added note: * not available in the h8s/2237 group and h8s/2227 group.
rev. 5.00 aug 08, 2006 page xv of l xxxvi item page revision (see manual for details) 10.4.4 pin functions 325 ? p74/tmo2/ mres description amended ... os3 to os0 bits in tcsr_2 of tmr_2 * , the mrese ... table amended os3 to os0 * tmo2 * output note added note: * not available in the h8s/2237 group and h8s/2227 group. 325 ? p73/tmo1/ tend1 / cs7 description amended ... dmatcr of dmac * , os3 to os0 ... table amended tend1 * output pin 325 ? p72/tmo0/ tend0 / cs6 description amended ... dmatcr of dmac * , os3 to os0 ... table amended tend0 * output pin 326 ? p71/tmri23/tmci23/ dreq1 / cs5 table amended operating mode modes 4 to 6 mode 7 p71ddr0101 p71 input pin cs5 output pin p71 input pin p71 output pin pin functions tmri23 * 1 , tmci23 * 1 , dreq1 * 2 input pin ? * 1 , tmci23 * 1 , dreq1 * 2 input pin note 1 added note: 1. not available in the h8s/2237 group and h8s/2227 group. 326 ? p70/tmri01/tmci01/ dreq0 / cs4 table amended tmri01, tmci01, dreq0 * input pin
rev. 5.00 aug 08, 2006 page xvi of l xxxvi item page revision (see manual for details) 10.6.6 pin functions 330 ? pa3/a19/sck2 description amended ... smr_2 of sci_2 * 2 , cke1 and cke0 bits... table amended operating mode modes 4 to 6 ae3 to ae0 b'11xx other than b'11xx cke1 ? ? ? ? 0 1 c/ a * 2 0 1 ? cke0 0 1 ? ? pa3ddr 0 1 ? ? ? pin functions a19 output pin pa3 input pin pa3 output pin * 1 sck2 * 2 output pin * 1 sck2 * 2 output pin * 1 sck2 * 2 input pin operating mode mode 7 ae3 to ae0 a * 2 01 ? cke0 0 1 ?? pa3ddr 0 1 ??? pin functions pa3 input pin pa3 output pin * 1 sck2 * 2 output pin * 1 sck2 * 2 output pin * 1 sck2 * 2 input pin note 2 added note: 2. not available in the h8s/2227 group. 331 ? pa2/a18/rxd2 description amended ... scr_2 of sci_2 * 2 , and the pa2ddr bit. table amended operating mode modes 4 to 6 mode 7 ae3 to ae0 b'1011 or b'11xx other than (b'1011 or b'11xx) ? * 2 ? ? ? ? * 1 rxd2 * 2 input pin pa2 input pin pa2 output pin * 1 rxd2 * 2 input pin note 2 added note: 2. not available in the h8s/2227 group.
rev. 5.00 aug 08, 2006 page xvii of l xxxvi item page revision (see manual for details) 10.6.6 pin functions 331 ? pa1/a17/txd2 description amended ... scr_2 of sci_2 * 2 , and the pa1ddr bit. table amended operating mode modes 4 to 6 mode 7 ae3 to ae0 b'101x or b'11xx other than (b'101x or b'11xx) ? * 2 ? ? ? ? * 1 txd2 * 2 output pin * 1 pa1 input pin pa1 output pin * 1 txd2 * 2 output pin * 1 note 2 added note: 2. not available in the h8s/2227 group. 10.7.5 pin functions 335 ? pb7/a15/tiocb5 description amended ... the tpu channel 5 * 3 setting, ae3 to ae0 bits... table amended operating mode modes 4 to 6 mode 7 ae3 to ae0 b'1xxx other than b'1xxx ? * 1 * 3 ? ?? ? * 3 output pin tiocb5 * 3 input pin * 2 tiocb5 * 3 output pin tiocb5 * 3 input pin * 2 note 3 added note: 3. not available in the h8s/2227 group.
rev. 5.00 aug 08, 2006 page xviii of l xxxvi item page revision (see manual for details) 10.7.5 pin functions 335 ? pb6/a14/tioca5 description amended ... the tpu channel 5 * 3 setting, ae3 to ae0 bits... table amended * 3 operating mode modes 4 to 6 mode 7 ae3 to ae0 b'0111 or b'1xxx other than (b'0111 or b'1xxx) ? * 1 ? ?? ? * 3 output pin tioca5 * 3 input pin * 2 tioca5 * 3 output pin tioca5 * 3 input pin * 2 note 3 added note: 3. not available in the h8s/2227 group. 336 ? pb5/a13/tiocb4 description amended ... the tpu channel 4 * 3 setting, ae3 to ae0 bits... table amended operating mode modes 4 to 6 mode 7 ae3 to ae0 b'011x or b'1xxx other than (b'011x or b'1xxx) ? * 1 * 3 ? ?? ? * 3 output pin tiocb4 * 3 input pin * 2 tiocb4 * 3 output pin tiocb4 * 3 input pin * 2 note 3 added note: 3. not available in the h8s/2227 group.
rev. 5.00 aug 08, 2006 page xix of lxxxvi item page revision (see manual for details) 10.7.5 pin functions 336 ? pb4/a12/tioca4 description amended ... the tpu channel 4 * 3 setting, ae3 to ae0 bits... table amended operating mode modes 4 to 6 mode 7 ae3 to ae0 other than (b'0100 or b'00xx) b'0100 or b'00xx ? * 1 * 3 ? ?? ? * 3 output pin tioca4 * 3 input pin * 2 tioca4 * 3 output pin tioca4 * 3 input pin * 2 note 3 added note: 3. not available in the h8s/2227 group. 337 ? pb3/a11/tiocd3 description amended ... the tpu channel 3 * 3 setting, ae3 to ae0 bits... table amended operating mode modes 4 to 6 mode 7 ae3 to ae0 other than b'00xx b'00xx ? * 1 * 3 ? ?? ? * 3 output pin tiocd3 * 3 input pin * 2 tiocd3 * 3 output pin tiocd3 * 3 input pin * 2 1 note 3 added note: 3. not available in the h8s/2227 group.
rev. 5.00 aug 08, 2006 page xx of l xxxvi item page revision (see manual for details) 10.7.5 pin functions 337 ? pb2/a10/tiocc3 description amended ... the tpu channel 3 * 3 setting, ae3 to ae0 bits... table amended operating mode modes 4 to 6 mode 7 ae3 to ae0 other than (b'0010 or b'000x) b'0010 or b'000x ? * 1 * 3 ? ?? ? * 3 output pin tiocc3 * 3 input pin * 2 tiocc3 * 3 output pin tiocc3 * 3 input pin * 2 note 3 added note: 3. not available in the h8s/2227 group. 338 ? pb1/a9/tiocb3 description amended ... the tpu channel 3 * 3 setting, ae3 to ae0 bits... table amended operating mode modes 4 to 6 mode 7 ae3 to ae0 other than b'000x b'000x ? * 1 * 3 ? ?? ? * 3 3 output pin tiocb3 * 3 input pin * 2 tiocb3 * 3 output pin tiocb3 * 3 input pin * 2 1 note 3 added note: 3. not available in the h8s/2227 group.
rev. 5.00 aug 08, 2006 page xxi of lxxxvi item page revision (see manual for details) 10.7.5 pin functions 338 ? pb0/a8/tioca3 description amended ... the tpu channel 3 * 3 setting, ae3 to ae0 bits... table amended operating mode modes 4 to 6 mode 7 ae3 to ae0 other than b'0000 b'0000 ? * 1 * 3 ? ?? ? * 3 output pin tioca3 * 3 input pin * 2 tioca3 * 3 output pin tioca3 * 3 input pin * 2 note 3 added note: 3. not available in the h8s/2227 group. 10.9.6 input pull-up mos states in port d table 10.5 input pull-up mos states in port d 345 table 10.5 amended port i/o (modes 4 to 6) port input (mod e 7) 10.12.4 pin functions 356 ? pg3/ rx / cs1 description amended ... iectr of ieb * 3 , operating mode... ? pg2/ tx / cs2 description amended ... iectr of ieb * 3 , operating mode... 11. 16-bit timer pulse unit (tpu) 359 description amended ... that comprises three 16-bit timer channels or six 16-bit timer channels. ... 11.3.1 timer control register (tcr) 367 description amended ... for each channel. the tpu of the h8s/2227 group has a total of three tcr registers, one each for channels 0 to 2. in other groups, the tpu has a total of six tcr registers, one each for channels 0 to 5. tcr register settings ... ckeg1 and ckeg0 description amended ... channels 1, 2, 4 * , and 5 * , this setting is ignored ... note * added note: * not available in the h8s/2227 group.
rev. 5.00 aug 08, 2006 page xxii of l xxxvi item page revision (see manual for details) 368 table 11.3 amended channel 0, 3 * 3 11.3.1 timer control register (tcr) table 11.3 cclr2 to cclr0 (channels 0 and 3) note 3 added note: 3. not available in the h8s/2227 group. 368 table 11.4 amended channel 1, 2, 4 * 3 , 5 * 3 table 11.4 cclr2 to cclr0 (channels 1, 2, 4, and 5) note 3 added note: 3. not available in the h8s/2227 group. 11.3.2 timer mode register (tmdr) 372 description amended ... for each channel. the tpu of the h8s/2227 group has a total of three tmdr registers, one each for channels 0 to 2. in other groups, the tpu has a total of six tmdr registers, one each for channels 0 to 5. tmdr register settings ... bfb and bfa description amended ... in channels 1, 2, 4 * , and 5 * , which have no ... note * added note: * not available in the h8s/2227 group. 11.3.3 timer i/c control register (tior) 373 description amended ... the tgr registers. the tpu of the h8s/2227 group has a total of four tior registers, two for channel 0 and one each for channels 1 and 2. in other groups, the tpu has a total of eight tior registers, two each for channels 0 and 3, and one each for channels 1, 2, 4, and 5. care is required since ... 374 tiorh_0, tior_1, tior_2, tiorh_3 * , tior_4 * , tior_5 * note * added note: * not available in the h8s/2227 group. tiorl_0, tiorl_3 * note * added note: * not available in the h8s/2227 group.
rev. 5.00 aug 08, 2006 page xxiii of l xxxvi item page revision (see manual for details) 11.3.4 timer interrupt enable register (tier) 391 description amended ... for each channel. the tpu of the h8s/2227 group has a total of three tier registers, one each for channels 0 to 2. in other groups, the tpu has a total of six tier registers, one each for channels 0 to 5. care is required since ... 391, 392 tcieu, tgied, tgiec description amended ... in channels 1, 2, 4 * , and 5 * ... channels 0 and 3 * , ... 392 note * added note: * not available in the h8s/2227 group. 11.3.5 timer status register (tsr) 393 description amended ... of each channel. the tpu of the h8s/2227 group has a total of three tsr registers, one each for channels 0 to 2. in other groups, the tpu has a total of six tsr registers, one each for channels 0 to 5. 393, 394 table amended ... channels 1, 2, 4 * 3 , and 5 * 3 ... channels 0 and 3 * 3 395 note 3 added note: 3. not available in the h8s/2227 group. 11.3.6 timer counter (tcnt) 396 description amended ... readable/writable counters. the tpu of the h8s/2227 group has a total of three tcnt registers, one each for channels 0 to 2. in other groups, the tpu has a total of six tcnt registers, one each for channels 0 to 5. 11.3.7 timer general register (tgr) 396 description amended ... input capture registers. the tpu of the h8s/2227 group has a total of four tgr registers, two for channel 0 and one each for channels 1 and 2. in other groups, the tpu has a total of eight tgr registers, two each for channels 0 and 3, and one each for channels 1, 2, 4, and 5. 11.3.8 timer start register (tstr) 396 description amended in the h8s/2227 group, tstr selects operate/stop for channels 0 to 2. in other groups, tstr selects operate/stop for channels 0 to 5. when setting ... table amended cdt5 * cdt4 * cdt3 * note * added note: * in the h8s/2227 group, bits 5 to 3 are reserved. the write value should always be 0.
rev. 5.00 aug 08, 2006 page xxiv of l xxxvi item page revision (see manual for details) 11.3.9 timer synchronous register (tsyr) 397 description amended in the h8s/2227 group, tsyr selects independent or synchronous tcnt operation for channels 0 to 2. in other groups, tsyr selects independent or synchronous tcnt operation for channels 0 to 5. a channel performs ... table amended sync5 * sync4 * sync3 * note * added note: * in the h8s/2227 group, bits 5 to 3 are reserved. the write value should always be 0. 11.4.1 basic functions 398 description amended counter operation: when one of bits cst2 to cst0 (h8s/2227 group) or bits cst5 to cst0 (groups other than h8s/2227) in tstr is set to 1, the tcnt counter for the corresponding channel starts counting. tcnt can operate ... 402 description amended ... for channels 0, 1, 3 * , and 4 * , it is also possible ... note * added note: * not available in the h8s/2227 group. 11.4.2 synchronous operation 403 description amended ... single time base. channels 0 to 2 (h8s/2227 group) or 0 to 5 (groups other than h8s/2227) can all be designated for synchronous operation. 405 table 11.28 amended channel 3 * 11.4.3 buffer operation table 11.28 register combinations in buffer operation note * added note: * not available in the h8s/2227 group. 11.4.6 phase counting mode 416 description amended ... incremented/decremented accordingly. in the h8s/2227 group, this mode can be set for channels 1 and 2. in other groups, it can be set for channels 1, 2, 4, and 5. 416 table 11.31 amended channel 1 or 5 * channel 2 or 4 * table 11.31 clock input pins in phase counting mode note * added note: * not available in the h8s/2227 group.
rev. 5.00 aug 08, 2006 page xxv of l xxxvi item page revision (see manual for details) 417 figure 11.26 amended (channels 1 and 5 * ) (channels 2 and 4 * ) 11.4.6 phase counting mode figure 11.26 example of phase counting mode 1 operation note * added note: * not available in the h8s/2227 group. 418 table 11.32 amended (channels 1 and 5 * ) (channels 2 and 4 * ) table 11.32 up/down-count conditions in phase counting mode 1 note * added note: * not available in the h8s/2227 group. 419 figure 11.27 amended (channels 1 and 5 * ) (channels 2 and 4 * ) figure 11.27 example of phase counting mode 2 operation note * added note: * not available in the h8s/2227 group. 419 table 11.33 amended (channels 1 and 5 * ) (channels 2 and 4 * ) table 11.33 up/down-count conditions in phase counting mode 2 note * added note: * not available in the h8s/2227 group. 419 figure 11.28 amended (channels 1 and 5 * ) (channels 2 and 4 * ) figure 11.28 example of phase counting mode 3 operation note * added note: * not available in the h8s/2227 group. 420 table 11.34 amended (channels 1 and 5 * ) (channels 2 and 4 * ) table 11.34 up/down-count conditions in phase counting mode 3 note * added note: * not available in the h8s/2227 group. 421 figure 11.29 amended (channels 1 and 5 * ) (channels 2 and 4 * ) figure 11.29 example of phase counting mode 4 operation note * added note: * not available in the h8s/2227 group. 421 table 11.35 amended (channels 1 and 5 * ) (channels 2 and 4 * ) table 11.35 up/down-count conditions in phase counting mode 4 note * added note: * not available in the h8s/2227 group.
rev. 5.00 aug 08, 2006 page xxvi of l xxxvi item page revision (see manual for details) 11.5 interrupt sources 425 description amended input capture/compare match interrupt: ... in the h8s/2227 group, the tpu has eight input capture/compare match interrupts, four for channel 10 and two each for channels 1 and 2 . in other groups, the tpu has 16 input capture/compare match interrupts, four each for channels 0 and 3, and two each for channels 1, 2, 4, and 5. overflow interrupt: ... in the h8s/2227 group, the tpu has three overflow interrupts, one each for channels 0 to 2. in other groups, the tpu has six overflow interrupts, one each for channels 0 to 5. underflow interrupt: ... the tpu of the h8s/2227 group has two underflow interrupts, one each for channels 1 and 2. in other groups, the tpu has four underflow interrupts, one each for channels 1, 2, 4, and 5. 11.6 dtc activation 425 description amended ... data transfer controller (dtc). in the h8s/2227 group, a total of eight tpu input capture/compare match interrupts can be used as dtc activation sources, four for channel 0 and two each for channels 1 and 2. in other groups, a total of 16 tpu input capture/compare match interrupts can be used as dtc activation sources, four each for channels 0 and 3, and two each for channels 1, 2, 4, and 5. 11.10.12 contention between tcnt write and overflow/underflow figure 11.54 contention between tcnt write and overflow 440 figure 11.54 replaced 11.10.14 interrupts and module stop mode 440 description amended ... source or the dmac * or dtc activation ... note * added note: * supported only by the h8s/2239 group.
rev. 5.00 aug 08, 2006 page xxvii of lxxxvi item page revision (see manual for details) 12.1 features 441 description amended ? cascading of the two channels ... ? mr_2 * and tmr_3 * cascading ... 442 note * added note: * not available in the h8s/2237 group and h8s/2227 group. figure 12.1 block diagram of 8-bit timer module 442 note * amended note: * when a sub-clock is operating in power-down mode, will be sub . 12.2 input/output pins table 12.1 pin configuration 443 note * amended note: * not available in the h8s/2237 group and h8s/2227 group. 12.3 register descriptions 444 note * amended note: * not available in the h8s/2237 group and h8s/2227 group. 12.3.1 timer counter (tcnt) 444 description amended ... (tcnt_2 and tcnt_3) * comprise ... note * added note: * not available in the h8s/2237 group and h8s/2227 group. 12.3.2 time constant register a (tcora) 444 description amended ... (tcora_2 and tcora_3) * comprise ... note * added note: * not available in the h8s/2237 group and h8s/2227 group. 12.3.3 time constant register b (tcorb) 445 description amended ... (tcorb_2 and tcorb_3) * comprise ... note * added note: * not available in the h8s/2237 group and h8s/2227 group.
rev. 5.00 aug 08, 2006 page xxviii of l xxxvi item page revision (see manual for details) 12.3.4 timer control register (tcr) 446 table amended bit bit name initial value r/w description 2 1 0 cks2 cks1 cks0 0 0 0 r/w r/w r/w clock select 2 to 0 the input clock can be selected from three clocks divided from the system clock ( * 1 for channel 1: counted on tcnt0 compare-match a * 1 for channel 2: * 2 counted on tcnt3 overflow signal * 1 for channel 3: * 2 counted on tcnt2 compare-match a * 1 101: external clock source, counted at rising edge 110: external clock source, counted at falling edge 111: external clock source, counted at both rising and falling edges note 2 added note: 2. not available in the h8s/2237 group and h8s/2227 group. 12.3.5 timer control/status register (tcsr) 449 ? tcsr_1 and tcsr_3 * 1 table amended r/(w) * 2 450 note 1 added note: 1. not available in the h8s/2237 group and h8s/2227 group. 451 ? tcsr_2 * 1 table amended r/(w) * 2 452 note 1 added note: 1. not available in the h8s/2237 group and h8s/2227 group.
rev. 5.00 aug 08, 2006 page xxix of l xxxvi item page revision (see manual for details) 12.6 operation with cascaded connection 457 description amended ... (tcr_2 and tcr_3) * ... (channel 2) * ... (channel 3) * note * added note: * not available in the h8s/2237 group and h8s/2227 group. 458 table 12.2 amended interrupt source description cmia2 * tcora_2 compare-match cmib2 * tcorb_2 compare-match ovi2 * tcnt_2 overflow cmia3 * tcora_3 compare-match cmib3 * tcorb_3 compare-match ovi3 * tcnt_3 overflow 12.7.1 interrupt sources and dtc activation table 12.2 8-bit timer interrupt sources note * added note: * not available in the h8s/2237 group and h8s/2227 group. 12.8.7 mode setting of cascaded connection 464 description amended ... (tcnt_2 and tcnt_3) * ... note * added note: * not available in the h8s/2237 group and h8s/2227 group. 466 figure 13.1 amended internal clock sources * 2 13.1 features figure 13.1 block diagram of wdt_0 (1) note 2 amended note: 2. when a sub-clock is operating in power-down mode, will be sub . figure 13.1 block diagram of wdt_1 (2) 467 note * 2 deleted 13.4.2 interval timer mode 474 description added ... tcnt overflows. (the nmi interrupt is not generated.) therefore, an interrupt can be generated at intervals. 13.4.4 timing of setting watchdog timer overflow flag (wovf) 476 description added ... if tcnt overflows ... entire chip. (the wovi interrupt is not generated.) this timing is illustrated in figure 13.5.
rev. 5.00 aug 08, 2006 page xxx of l xxxvi item page revision (see manual for details) 14.1.3 transfer data (data field contents) 495 subheading amended (4) locking/unlocking (control bits: setting (h'3, h'a, h 'b), cancellation: (h'6)) 14.3.3 iebus master control register (iemcr) 503 r/w description of ctl 3 to 0 amended r/w 14.4.2 slave receive operation figure 14.10 error occurrence in the broadcast reception (dee=1) 533 figure 14.10 amended set the rxe flag and the master unit address in ie ma1 and ie ma2. 15.3.2 receive data register (rdr) 552 description amended ... watch mode, subactive mode, subsleep mode , or ... 15.3.5 serial mode register (smr) 555 ? smart card interface mode (when smif in scmr is 1) bit 7 gm and bit 6 blk description added bit bit name initial value r/w description 7 gm 0 r/w gsm mode when this bit is set to 1, the sci operates in gsm mode. in gsm mode, the timing of the tend setting is advanced by 11.0 etu (elementary time unit: the time for transfer of 1 bit), and clock output control mode addition is performed. for details, refer to section 15.7.8, clock output control. 0: normal smart card interface mode operation (initial value) ? ? ? ?
rev. 5.00 aug 08, 2006 page xxxi of l xxxvi item page revision (see manual for details) 15.3.5 serial mode register (smr) 556 bit bit name initial value r/w description 6 blk 0 r/w when this bit is set to 1, the sci operates in block transfer mode. for details on block transfer mode, refer to section 15.7.3, block transfer mode. 0: normal smart card interface mode operation (initial value) ? ? ? ? ? ? 15.3.7 serial status register (ssr) 565 ? normal serial communication interface mode (when smif in scmr is 0) bit 2 tend description amended [clearing conditions] ... ? when the dmac * 2 or the dtc * 3 is ... 569 ? smart card interface mode (when smif in scmr is 1) bit 2 tend description amended [setting conditions] ? when the te bit in scr is 0 ... ? when the e rs bit is 0 and the tdre bit is 1 after the specified interval following transmission of 1-byte data. ... [clearing conditions] ... ? when the dmac * 2 or the dtc * 3 is ... 572 to 574 note * 3 added to items of "operating frequency (mhz)" 2 * 3 2.097152 * 3 2.4576 * 3 3 * 3 3.6864 * 3 4 * 3 4.9152 * 3 5 * 3 6 * 3 6.144 * 3 7.3728 * 3 8 * 3 9.8304 * 3 15.3.9 bit rate register (brr) table 15.3 brr setting for various bit rates (asynchronous mode) 575 note 3 added note: 3. the h8s/2258 group is out of operation.
rev. 5.00 aug 08, 2006 page xxxii of lxxxvi item page revision (see manual for details) 15.3.9 bit rate register (brr) table 15.4 maximum bit rate for each frequency (asynchronous mode) 576 note * 2 added to table 15.4 (mhz) maximum bit rate (kbps) nn (mhz) maximum bit rate (kbps) nn 2 * 2 62.5 0 0 9.8304 * 2 307.2 0 0 2.097152 * 2 65.536 0 0 10 312.5 0 0 2.4576 * 2 76.8 0 0 12 375.0 0 0 3 * 2 93.75 0 0 12.288 384.0 0 0 3.6864 * 2 115.2 0 0 14 * 1 437.5 0 0 4 * 2 125.0 0 0 14.7456 * 1 460.8 0 0 4.9152 * 2 153.6 0 0 16 * 1 500.0 0 0 5 * 2 156.25 0 0 17.2032 * 1 537.6 0 0 6 * 2 187.5 0 0 18 * 1 562.5 0 0 6.144 * 2 192.0 0 0 19.6608 * 1 614.4 0 0 7.3728 * 2 230.4 0 0 20 * 1 625.0 0 0 8 * 2 250.0 0 0 note 2 added note s: 1. supported only by the h8s/2239 group. 2. the h8s/2258 group is out of operation. table 15.5 maximum bit rate with external clock input (asynchronous mode) 577 note * 2 added to table 15.5 (mhz) external input clock (mhz) maximum bit rate (kbps) (mhz) external input clock (mhz) maximum bit rate (kbps) 2 * 2 0.5000 31.25 9.8304 * 2 2.4576 153.6 2.097152 * 2 0.5243 32.768 10 2.5000 156.25 2.4576 * 2 0.6144 38.4 12 3.0000 187.5 3 * 2 0.7500 46.875 12.288 3.0720 192.0 3.6864 * 2 0.9216 57.6 14 * 1 3.5000 218.75 4 * 2 1.0000 62.5 14.7456 * 1 3.6864 230.4 4.9152 * 2 1.2288 76.8 16 * 1 4.0000 250.0 5 * 2 1.2500 78.125 17.2032 * 1 4.3008 268.8 6 * 2 1.5000 93.75 18 * 1 4.5000 281.3 6.144 * 2 1.5360 96.0 19.6608 * 1 4.9152 307.2 7.3728 * 2 1.8432 115.2 20 * 1 5.0000 312.5 8 * 2 2.0000 125.0 note 2 added note s: 1. supported only by the h8s/2239 group. 2. the h8s/2258 group is out of operation.
rev. 5.00 aug 08, 2006 page xxxiii of l xxxvi item page revision (see manual for details) 15.3.9 bit rate register (brr) table 15.6 brr setting for various bit rates (clocked synchronous mode) 578, 579 table 15.6 amended operating frequency (mhz) 2 * 2 4 * 2 6 * 2 8 * 2 bit rate (bps)n nn nn nn n 110 3 70 ?? 250 2 124 2 249 3 124 500 1 249 2 124 2 249 1 k 1 124 1 249 2 124 2.5 k 0 199 1 99 1 149 1 199 5 k 0 99 0 199 1 74 1 99 10 k 0 49 0 99 0 149 0 199 25 k 0 19 0 39 0 59 0 79 50 k 0 9 0 19 0 29 0 39 100 k 0 4 09014019 250 k 0 1 030507 500 k 0 0 * 010203 1 m 0 0 * 01 2.5 m 5 m note 2 added note: 2. the h8s/2258 group is out of operation. 579 note * 2 added to table 15.7 2 * 2 4 * 2 6 * 2 8 * 2 14 * 1 16 * 1 18 * 1 20 * 1 table 15.7 maximum bit rate with external clock input (clocked synchronous mode) note 2 added note s: 1. supported only by the h8s/2239 group. 2. the h8s/2258 group is out of operation. 580 note * 2 added to table 15.9 5.00 * 2 7.00 * 2 7.1424 * 2 14.2848 * 1 16.00 * 1 18.00 * 1 20.00 * 1 table 15.8 examples of bit rate for various brr settings (smart card interface mode) (when n = 0 and s = 372) note 2 added note s: 1. supported only by the h8s/2239 group. 2. the h8s/2258 group is out of operation. 580 note * 2 added to table 15.9 5.00 * 2 7.00 * 2 7.1424 * 2 14.2848 * 1 16.00 * 1 18.00 * 1 20.00 * 1 table 15.9 maximum bit rate at various frequencies (smart card interface mode) when s = 372) note 2 added note s: 1. supported only by the h8s/2239 group. 2. the h8s/2258 group is out of operation. 15.3.10 serial expansion mode register (semr_0) 582 table amended 0 10: selects the average transfer rate 460.606 kbps ...
rev. 5.00 aug 08, 2006 page xxxiv of l xxxvi item page revision (see manual for details) 15.4 operation in asynchronous mode 585 description amended ... when the abcs bit in semr_0 is 1 (h8s/2239 group only). 587 description amended ... n : bit rate ratio relative to clock (n = 16, but in the h8s/2239 group n = 8 if abcs in semr_0 is set to 1.) 15.4.2 receive data sampling timing and reception margin in asynchronous mode note amended note: example for h8s/2239 group with the abcs bit in semr_0 set to a value other than 1. when abcs is ... figure 15.6 receive data sampling timing in asynchronous mode 588 note amended note: example for h8s/2239 group with the abcs bit in semr_0 set to a value other than 1. when abcs is ... 589 figure 15.8 amended set te and re * 1 bits in scr to 1, ... [3] ... bits ac s2 to acs0 in semr_0 * 2 is used. 15.4.4 sci initialization (asynchronous mode) figure 15.8 sample sci initialization flowchart note 2 added note: 2. supported only by the h8s/2239 group. 15.5.2 multiprocessor serial data reception figure 15.16 sample multiprocessor serial reception flowchart (1) 600 figure 15.16 amended (before) read mpie bit in scr (after) set mpie bit in scr to 1 15.10.5 restrictions on use of dmac * or dtc figure 15.38 example of clocked synchronous transmission by dmac * or dtc 626 note * added note: * supported only by the h8s/2239 group. 16.1 features 633 description amended ? selection of i 2 c bus format or clocked synchronous serial format 634 description amended ? interrupt sources ? data transfer end ... ? address match: when ... in slave receive mode ? start condition detection (in master mode) ? stop condition detection (in slave mode)
rev. 5.00 aug 08, 2006 page xxxv of l xxxvi item page revision (see manual for details) 642 table 16.3 amended = 5 mhz * 3 = 8 mhz * 3 16.3.4 i 2 c bus mode register (icmr) table 16.3 i 2 c transfer rate note 3 added note: 3. the h8s/2258 group is out of operation. 16.3.6 i 2 c bus control register (iccr) 646 table amended ... (as it might not be a condition to clear, for details, see section 16.4.8, operation using the dtc) 16.4.1 i 2 c bus data format 653 description amended ... in figure 16.3. the clocked synchronous serial format is a non-addressing format with no acknowledge bit. ... 16.4.2 initial setting figure 16.6 flowchart for iic initialization (example) 655 figure 16.6 amended set i cmr 16.4.3 master transmit operation figure 16.7 flowchart for master transmit mode (example) 656 figure 16.7 amended yes [12] generate stop condition. clear iric flag in iccr write bbsy = 0 and scp = 0 (iccr) write acke = 0 (iccr) (clear ackb = 0) end 657 description amended [6] ... the master device sequentially sends the transmit clock and the data written to icdr using the timing shown in figure 16.8. the at the 9th ... [12] ... clear the iric flag to 0. write 0 to bbsy and scp ... figure 16.8 example of master transmit mode operation timing (mls = wait = 0) 658 figure 16.8 amended (before) r/ w (after) r/ w
rev. 5.00 aug 08, 2006 page xxxvi of l xxxvi item page revision (see manual for details) 16.4.4 master receive operation 662 description amended [6] clear the ir ic flag to 0. the reading of the icdr flag described in step [5] and the clearing of the iric flag to 0 should be performed consecutively, with no interrupt processing occurring between them. during wait operation, clear the iric flag to 0 when the value of counter bc2 to bc0 is 2 or greater. if the iric flag is cleared to 0 when the value of counter bc2 to bc0 is 1 or 0, it will not be possible to determine when the transfer has completed. if condition [3]-1 is true, ... [11] clear the ir ic flag to 0. as in step [6 ], read the icdr flag and clear the iric flag to 0 consecutively, with no interrupt processing occurring between them. during wait operation, clear the iric flag to 0 when the value of counter bc2 to bc0 is 2 or greater. figure 16.13 example of master receive mode top condition generation timing (mls = ackb = 0, wait = 1) 664 figure 16.13 amended 9 82 1345678 9 a a data 2 data 3 data 3 data 2 data 1 [3] [3] [8] [12] [12] stop condition generated [4] irtr = 0 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bit 0 1 clock cycle wait time bit 7 [4] irtr = 1 [13] irtr = 1 [13] irtr = 0 [15] wait cleared to 0 iric clearance [14] iric clearance [11] iric clearance [6] iric clearance user processing [10] icdr read (data 2) [16] icdr read (data 3) [9] trs set to 1 [7] ackb set to 1 scl (master output) sda (slave output) sda (master output) iric irtr icdr [17] stop condition issued 16.4.5 slave receive operation 666 description amended (5) read icdr and clear the iric flag in iccr to 0. the rdrf flag is cleared to 0. read the irdr flag and clear the iric flag to 0 consecutively, with no interrupt processing occurring between them. if the time needed to transmit one byte of data elapses before the iric flag is cleared, it will not be possible to determine when the transfer has completed. figure 16.15 example of slave receive mode operation timing (1) (mls = ackb = 0) 667 description of "interrupt request generation" deleted from figure 16.15 figure 16.16 example of slave receive mode operation timing (2) (mls = ackb = 0) 668 description of "interrupt request generation" deleted from figure 16.16
rev. 5.00 aug 08, 2006 page xxxvii of l xxxvi item page revision (see manual for details) 16.4.6 slave transmit operation 669 to 671 section 16.4.6 description replaced figure 16.18 example of slave transmit mode operation timing (mls = 0) 671 figure 16.18 replaced 16.4.8 operation using the dtc table 16.5 flags and transfer states 673 table 16.5 amended item master transmit mode master receive mode slave transmit mode slave receive mode slave address + r/ w bit transmission/ reception transmission by dtc (icdr write) transmission by cpu (icdr write) reception by cpu (icdr read) reception by cpu (icdr read) dummy data read ? ?? 16.6 usage notes 676 description amended 1. ... the start condition, read port in each i 2 c bus output pin, and check that scl and sda are both low. even if the ice bit is set to 1, it is possible to monitor the pin state by reading the port register so long as the ddr i/o port register corresponding to the pin has been cleared to 0.then issue the instruction ... 2. either of ... ? read access to icdr when ice = 1 and trs = 0 (including automatic transfer from ic drs to icdrr) 678 note * 2 added to table 16.8 = 5 mhz * 2 = 8 mhz * 2 = 16 mhz * 1 = 20 mhz * 1 table 16.8 permissible scl rise time (t sr ) values note 2 added note s: 1. supported only by the h8s/2239 group. 2. the h8s/2258 group is out of operation. 679 note * 7 added to table 16.9 = 5 mhz * 7 = 8 mhz * 7 table 16.9 i 2 c bus timing (with maximum influence of t sr /t sf ) 680 note 7 added note: 7. the h8s/2258 group is out of operation. figure 16.22 flowchart and timing of start condition instruction issuance for retransmission 681 figure 16.22 amended (before) [2] determine whether scl 0 is low (after) determine whether scl is low
rev. 5.00 aug 08, 2006 page xxxv iii of l xxxvi item page revision (see manual for details) 16.6 usage notes figure 16.26 trs bit setting timing in slave mode 684 figure 16.26 amended trs bit 686, 687 description of " 16. notes on wait operation in master mode" added 17.1 features 689 description added ? selectable range voltages of analog inputs the range of voltages of analog inputs to be converted can be specified using the v ref signal as the analog reference voltage. figure 17.1 block diagram of a/d converter 690 figure 17.1 amended 10- multiplexer an0 an1 an2 an3 an4 an5 an6 an7 av cc av ss vref 17.4 interface to bus master 696 section 17.4 description added 18.1 features 707 " ? d/a output retaining function in software standby mode" deleted 18.5.1 analog power supply current in power-down mode 711 section 18.5.1 description replaced 20.1 features figure 20.1 block diagram of flash memory 716 figure 20.1 amended h8s/22 27: 128 kbytes 20.3 block configuration figure 20.6 block configuration of 256-kbyte flash memory 722 figure 20.6 amended eb10 erase unit 64 kbytes
rev. 5.00 aug 08, 2006 page xxxix of l xxxvi item page revision (see manual for details) 741 figure 20.12 amended tse: wait 10 ms * 5 n 100? * 5 20.8.2 erase/erase-verify figure 20.12 erase/erase- verify flowchart note 5 added note: 5. this is a recommended value. to change it, consult tables 27.12, 27.25, 27.37, 27.49, and 27.59 and select a new value such that the erase time (t e ), wait time after e1 bit setting (t se ), and maximum erase count (n) do not exceed the maximum values indicated. 744 figure 20.13 amended fp-100b * 3 tfp-100g * 4 tbp-112a * 5 20.11 programmer mode figure 20.13 socket adapter pin correspondence diagram notes amended notes: 1. supported only by the h8s/ 2258 and h8s/2238 b. 2. supported only by the h8s/2238r. 3. not supported by the h8s/2227. 4. not supported by the h8s/2258. 5. supported only by the h8s/2238r and h8s/2239. 20.13 flash memory programming and erasing precautions figure 20.14 power-on/off timing (boot mode) 748 figure 20.14 amended md2 to md 0 * 1 figure 20.15 power-on/off timing (user program mode) 749 figure 20.15 amended md2 to md 0 * 1 figure 20.16 mode transition timing (example: boot mode user mode ? user program mode) 750 figure 20.16 amended md2 to md 0 21.1 features 753 ? size hd6432236bw and hd6432238rw added product class rom size rom address (modes 6 and 7) h8s/2238 group hd6432238b 256 kbytes h'000000 to h'03ffff hd6432236b 128 kbytes h'000000 to h'01ffff hd6432238r 256 kbytes h'000000 to h'03ffff hd6432236r 128 kbytes h'000000 to h'01ffff hd6432238bw 256 kbytes h'000000 to h'03ffff hd6432236bw 128 kbytes h'000000 to h'01ffff hd6432238rw 256 kbytes h'000000 to h'03ffff hd6432236rw 128 kbytes h'000000 to h'03ffff
rev. 5.00 aug 08, 2006 page xl of l xxxvi item page revision (see manual for details) 22.3.1 programming and verification figure 22.4 high-speed programming flowchart 760 figure 22.4 amended program width t opw = 0.2n ms 23.1.2 low-power control register (lpwrcr) 768 dton description amended direct transfer on flag 23.2.1 connecting a crystal resonator table 23.1 damping resistance value 771 note 1 amended note: 1. the h8s/2258 group is out of operation. table 23.2 crystal resonator characteristics 771 note 1 amended note: 1. the h8s/2258 group is out of operation. 23.2.2 external clock input ? table of "external clock input conditions (2) (h8s/2238 group, h8s/2237 group, h8s/2227 group)" deleted table 23.3 external clock input conditions (2) (h8s/2238b, h8s/2236b) table 23.3 external clock input conditions (3) (h8s/2238r, h8s/2236r) table 23.3 external clock input conditions (4) (h8s/2237 group, h8s/2227 group) 773, 774 tables 23.3 (2) to (4) added table 23.3 external clock input conditions ( 5) (h8s/2239 group) 774 table title amended 23.2.2 external clock input table 23.4 external clock input conditions (duty adjustment circuit unused) (1) (h8s/2258 group) 775 note added note: if the duty adjustment circuit is not used, maximum operating frequency is lowered according to the input waveform. (example: t exl = t exh = 37 ns, t exr = t exf = 7 ns, clock cycle time = 88 ns, and maximum operating frequency = 11.3 mhz) ? table of "external clock input conditions (duty adjustment circuit unused) (2) (h8s/2238 group, h8s/2237 group, h8s/2227 group)" deleted
rev. 5.00 aug 08, 2006 page xli of lxxxvi item page revision (see manual for details) 23.2.2 external clock input table 23.4 external clock input conditions (duty adjustment circuit unused) (2) (h8s/2238b, h8s/2236b) table 23.4 external clock input conditions (duty adjustment circuit unused) (3) (h8s/2238r, h8s/2236r) table 23.4 external clock input conditions (duty adjustment circuit unused) (4) (h8s/2237 group, h8s/2227 group) 775, 776 tables 23.4 (2) to (4) added table 23.4 external clock input conditions (duty adjustment circuit unused) ( 5) (h8s/2239 group) 777 note amended note: when a duty adjustment circuit is not used, maximum operating frequency is lowered according to the input waveform. (example: t exl = t exh = 25 ns, t exr = t exf = 5 ns, clock cycle time = 60 ns, and maximum operating frequency = 16.6 mhz) 23.2.3 notes on switching external clock figure 23.7 external clock switching timing (example) 778 figure 23.7 amended 200 ns or more clock 23.7.1 connecting 32.768- khz crystal resonator figure 23.9 equivalence circuit for 32.768-khz oscillator 780 figure 23.9 amended rs = 14 k ? (typ) 23.7.2 handling pins when subclock not required 781 description amended ... lpwrcr must be set to 1. if the substp bit is not set to 1, transitions to the power-down modes may not complete normally. 784, 785 note * 5 added to table 24.1 d/a * 3 * 5 section 24 power-down mode table 24.1 lsi internal states in each mode note 5 added note: 5. the analog output value does not satisfy the specified d/a absolute accuracy when d/a is halted (retained). however, the h8s/2258 group, h8s/2238b, and h8s/2236b satisfy the specified d/a absolute accuracy.
rev. 5.00 aug 08, 2006 page xlii of lx xxvi item page revision (see manual for details) 24.1.2 module stop control registers a to c (mstpcra to mstpcrc) 789 ? mstpcra target module description of mstpa0 amended 8-bit timer (tmr_2 * 3 , tmr_3 * 3 ) ? mstpcrb target module description of mstpb5 amended serial communication interface 2 (sci_2 * 4 ) 790 ? mstpcrc bit 3 description amended (before) mstpc3 * 1 * 5 (after) mstpc3 (before) iebus controller (after) iebus controller * 5 notes 3 and 4 amended notes: 3. not available in the h8s/2237 group and h8s/2227 group. 4. not available in the h8s/2227 group. 790 description amended ... the bus masters other than the cpu (dmac * and dtc)... 24.2 medium-speed mode 791 notes * added note: * supported only by the h8s/2239 group. 24.4.3 oscillation settling time after clearing software standby mode table 24.3 oscillation settling time settings 793 table 24.3 amended sts2 sts1 sts0 standby time 6 mhz * 2 4 mhz * 2 2 mhz * 2 unit 0 0 0 8192 states 1.4 2.0 4.1 ms 1 16384 states 2.7 4.1 8.2 1 0 32768 states 5.5 8.2 16.4 1 65536 states 10.9 16.4 32.8 1 0 0 131072 states 21.8 32.8 65.5 1 262144 states 43.7 65.5 131.1 10reserved ???? notes 1 and 2 amended notes: 1. supported only by the h8s/22 39 group. 2. the h8s/2258 group is out of operation. 24.6 module stop mode 796 note * added dmac * note: * supported only by the h8s/2239 group only.
rev. 5.00 aug 08, 2006 page xliii of lx xxvi item page revision (see manual for details) 24.12.4 on-chip module interrupt 801 ? module stop mode ? subactive mode/watch mode note * 2 added dmac * 1 iic * 2 note s: 1. supported only by the h8s/2239 group. 2. not available in the h8s/2237 group and h8s/2227 group. 26.3 register states in each operating mode 837 table amended register name reset manual reset high- speed medium- speed sleep module stop watch sub- active sub- sleep software standby hardware standby module icdr_0 initialized initialized initialized iic_0 sarx_0 initialized initialized initialized icmr_0 initialized initialized initialized sar_0 initialized initialized ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 27.1 power supply voltage and operating frequency range figure 27.3 power supply voltage and operating frequency ranges ( h8s/2238b and h8s/2236b) 841 figure 27.3 title amended figure 27.4 power supply voltage and operating frequency ranges (h8s/2238r and h8s/2236r) 842 figure 27.4 title amended
rev. 5.00 aug 08, 2006 page xliv of l xxxvi item page revision (see manual for details) 27.2.2 dc characteristics table 27.2 dc characteristics (1) 845, 846 table 27.2 amended item symbol res , stby , nmi, md2 to md0, fwe extal, ports 1, 3, 7, and a to g input high voltage ports 4 and 9 v ih res , stby , md2 to md0, fwe input low voltage nmi, extal, ports 1, 3, 4, 7, 9, and a to g v il res stby , nmi, md2 to md0, fwe input leakage current ports 4 and 9 | i in | 27.2.6 flash memory characteristics table 27.12 flash memory characteristics 863 note 7 amended note: 7. reference value at 25c. (normally, it is a reference that rewriting is enabled up to this value.) 27.3.2 dc characteristics table 27.14 dc characteristics (2) 868 note 3 amended note: 3. the values are for v ram v cc < 2. 7 v, v ih min = v cc ? 0.2, and v il max = 0.2 v. table 27.14 dc characteristics (3) 870 note 3 amended note: 3. the values are for v ram v cc < 2. 2 v, v ih min = v cc ? 0.2, and v il max = 0.2 v. 884 table 27.24 amended absolute accuracy * 27.3.5 d/a conversion characteristics table 27.24 d/a conversion characteristics note: * does not apply in module stop mode, software standby mode, watch mode, subactive mode, or subsleep mode. 27.3.6 flash memory characteristics table 27.25 flash memory characteristics 885 table 27.25 amended item symbol min typ max unit test conditions programming time * 1 * 2 * 4 t p ? * 1 * 3 * 5 t e ? * 6 10000 * 7 ? * 8 t drp 10 ??
rev. 5.00 aug 08, 2006 page xlv of lxxxvi item page revision (see manual for details) 27.3.6 flash memory characteristics table 27.25 flash memory characteristics 886 notes 6 and 7 amended, note 8 added notes: 6. the minimum times that all characteristics after rewriting are guaranteed. (a range between 1 and minimum value is guaranteed.) 7. the reference value at 25c. (normally, it is a reference that rewriting is enabled up to this value.) 8. data hold characteristics when rewriting is performed within the range of specifications including minimum value. 27.4 electrical characteristics of h8s/2238b and h8s/2236b 887 section 27.4 title amended 27.4.2 dc characteristics table 27.27 dc characteristics (1) 889 note 2 amended note: 2. in order to output high level, a pull-up resistance must be connected externally. 27.4.6 flash memory characteristics table 27.37 flash memory characteristics 905 table 27.37 amended item symbol min typ max unit test conditions programming time * 1 * 2 * 4 t p ? * 1 * 3 * 5 t e ? * 6 10000 * 7 ? * 8 t drp 10 ?? 906 notes 6 and 7 amended, note 8 added notes: 6. the minimum times that all characteristics after rewriting are guaranteed. (a range between 1 and minimum value is guaranteed.) 7. the reference value at 25c. (normally, it is a reference that rewriting is enabled up to this value.) 8. data hold characteristics when rewriting is performed within the range of specifications including minimum value. 924 table 27.48 amended absolute accuracy * 27.5.5 d/a conversion characteristics table 27.48 d/a conversion characteristics note * added note: * does not apply in module stop mode, software standby mode, watch mode, subactive mode, or subsleep mode. 27.5.6 flash memory characteristics table 27.49 flash memory characteristics 925 table 27.49 amended item symbol min typ max unit test conditions programming time * 1 * 2 * 4 t p ? * 1 * 3 * 5 t e ? * 6 * 8 100 10000 * 7 ? ??
rev. 5.00 aug 08, 2006 page xlvi of l xxxvi item page revision (see manual for details) 27.5.6 flash memory characteristics table 27.49 flash memory characteristics 926 notes 6 and 7 amended, note 8 added notes: 6. the minimum times that all characteristics after rewriting are guaranteed. (a range between 1 and minimum value is guaranteed.) 7. the reference value at 25c. (normally, it is a reference that rewriting is enabled up to this value.) 8. data hold characteristics when rewriting is performed within the range of specifications including minimum value. 27.6.2 dc characteristics table 27.52 permissible output currents 936 table 27.52 amended conditions ( ztat version and f-ztat version): 945 table 27.58 amended absolute accuracy * 27.6.5 d/a conversion characteristics table 27.58 d/a conversion characteristics note: * does not apply in module stop mode, software standby mode, watch mode, subactive mode, or subsleep mode. 27.6.6 flash memory characteristics table 27.59 flash memory characteristics 946 table 27.59 amended item symbol min typ max unit test conditions programming time * 1 * 2 * 4 t p ? * 1 * 3 * 5 t e ? * 6 10000 * 7 ? * 8 t drp 10 ?? 947 notes 6 and 7 amended, note 8 added notes: 6. the minimum times that all characteristics after rewriting are guaranteed. (a range between 1 and minimum value is guaranteed.) 7. the reference value at 25c. (normally, it is a reference that rewriting is enabled up to this value.) 8. data hold characteristics when rewriting is performed within the range of specifications including minimum value. a.1 i/o port state in each pin state 967 note 2 amended note: 2. not available in the h8s/2237 group and h8s/2227 group.
rev. 5.00 aug 08, 2006 page xlvii of lxxxvi contents section 1 overview ............................................................................................................. 1 1.1 features .................................................................................................................... ......... 1 1.2 internal block diagram..................................................................................................... 4 1.3 pin description............................................................................................................. ..... 9 1.3.1 pin arrangement .................................................................................................. 9 1.3.2 pin arrangements in each mode ......................................................................... 20 1.3.3 pin functions ....................................................................................................... 44 section 2 cpu ...................................................................................................................... 63 2.1 features .................................................................................................................... ......... 63 2.1.1 differences between h8s/2600 cpu and h8s/2000 cpu .................................. 64 2.1.2 differences from h8/300 cpu ............................................................................ 65 2.1.3 differences from h8/300h cpu.......................................................................... 65 2.2 cpu operating modes ...................................................................................................... 66 2.2.1 normal mode ....................................................................................................... 66 2.2.2 advanced mode ................................................................................................... 67 2.3 address space ............................................................................................................... .... 70 2.4 register configuration ...................................................................................................... 71 2.4.1 general registers ................................................................................................. 72 2.4.2 program counter (pc) ......................................................................................... 73 2.4.3 extended control register (exr) ....................................................................... 73 2.4.4 condition-code register (ccr) .......................................................................... 74 2.4.5 initial values of cpu registers ........................................................................... 75 2.5 data formats ................................................................................................................ ..... 76 2.5.1 general register data formats ............................................................................ 76 2.5.2 memory data formats ......................................................................................... 78 2.6 instruction set ............................................................................................................. ...... 79 2.6.1 table of instructions classified by function ....................................................... 80 2.6.2 basic instruction formats .................................................................................... 89 2.7 addressing modes and effective address calculation ..................................................... 90 2.7.1 register direct?rn............................................................................................. 91 2.7.2 register indirect?@ern .................................................................................... 91 2.7.3 register indirect with displacement?@(d:16, ern) or @(d:32, ern).............. 91 2.7.4 register indirect with post-increment?@ern+ or register indirect with pre-decrement?@-ern ............................................................................. 91 2.7.5 absolute address?@aa:8, @aa:16, @aa:24, or @aa:32.................................... 91 2.7.6 immediate?#xx:8, #xx:16, or #xx:32 ................................................................. 92
rev. 5.00 aug 08, 2006 page xlviii of l xxxvi 2.7.7 program-counter relative?@(d:8, pc) or @(d:16, pc).................................... 92 2.7.8 memory indirect?@@aa:8 ................................................................................ 93 2.7.9 effective address calculation ............................................................................. 94 2.8 processing states........................................................................................................... .... 96 2.9 usage notes ................................................................................................................. ..... 98 2.9.1 tas instruction.................................................................................................... 98 2.9.2 stm/ldm instruction ......................................................................................... 98 2.9.3 bit manipulation instructions .............................................................................. 98 2.9.4 access methods for registers with write-only bits ........................................... 100 section 3 mcu operating modes .................................................................................. 103 3.1 operating mode selection................................................................................................. 103 3.2 register descriptions ....................................................................................................... . 104 3.2.1 mode control register (mdcr) ......................................................................... 104 3.2.2 system control register (syscr) ...................................................................... 105 3.3 operating mode descriptions ........................................................................................... 106 3.3.1 mode 4 ................................................................................................................. 106 3.3.2 mode 5 ................................................................................................................. 106 3.3.3 mode 6 ................................................................................................................. 107 3.3.4 mode 7 ................................................................................................................. 107 3.3.5 pin functions ....................................................................................................... 108 3.4 memory map in each operating mode ............................................................................ 109 section 4 exception handling ......................................................................................... 119 4.1 exception handling types and priority............................................................................ 119 4.2 exception sources and exception vector table ............................................................... 119 4.3 reset121 4.3.1 reset types.......................................................................................................... 121 4.3.2 reset exception handling.................................................................................... 122 4.3.3 interrupts after reset............................................................................................ 123 4.3.4 state of on-chip peripheral modules after reset release................................... 123 4.4 traces...................................................................................................................... .......... 123 4.5 interrupts .................................................................................................................. ......... 124 4.6 trap instruction............................................................................................................ ..... 124 4.7 stack status after exception handling.............................................................................. 125 4.8 usage note.................................................................................................................. ...... 126 section 5 interrupt controller .......................................................................................... 127 5.1 features .................................................................................................................... ......... 127 5.2 input/output pins ........................................................................................................... ... 129
rev. 5.00 aug 08, 2006 page xlix of l xxxvi 5.3 register descriptions ....................................................................................................... . 129 5.3.1 interrupt priority registers a to l, and o (ipra to iprl, ipro) ...................... 130 5.3.2 irq enable register (ier) .................................................................................. 131 5.3.3 irq sense control registers h and l (iscrh and iscrl) ............................... 131 5.3.4 irq status register (isr).................................................................................... 134 5.4 interrupt sources ........................................................................................................... .... 135 5.4.1 external interrupts................................................................................................ 135 5.4.2 internal interrupts................................................................................................. 136 5.4.3 interrupt exception handling vector table......................................................... 136 5.5 operation................................................................................................................... ........ 142 5.5.1 interrupt control modes and interrupt operation ................................................ 142 5.5.2 interrupt control mode 0 ..................................................................................... 145 5.5.3 interrupt control mode 2 ..................................................................................... 147 5.5.4 interrupt exception handling sequence .............................................................. 148 5.5.5 interrupt response times .................................................................................... 150 5.5.6 dtc and dmac activation by interrupt ............................................................ 151 5.6 usage notes ................................................................................................................. ..... 154 5.6.1 contention between interrupt generation and disabling..................................... 154 5.6.2 instructions that disable interrupts ...................................................................... 155 5.6.3 when interrupts are disabled............................................................................... 155 5.6.4 interrupts during execution of eepmov instruction.......................................... 155 section 6 pc break controller (pbc) ........................................................................... 157 6.1 features .................................................................................................................... ......... 157 6.2 register descriptions ....................................................................................................... . 158 6.2.1 break address register a (bara) ..................................................................... 158 6.2.2 break address register b (barb)...................................................................... 159 6.2.3 break control register a (bcra) ...................................................................... 159 6.2.4 break control register b (bcrb)....................................................................... 160 6.3 operation................................................................................................................... ........ 160 6.3.1 pc break interrupt due to instruction fetch........................................................ 160 6.3.2 pc break interrupt due to data access............................................................... 161 6.3.3 notes on pc break interrupt handling ................................................................ 161 6.3.4 operation in transitions to power-down modes................................................. 161 6.3.5 when instruction execution is delayed by one state ......................................... 162 6.4 usage notes ................................................................................................................. ..... 163 6.4.1 module stop mode setting .................................................................................. 163 6.4.2 pc break interrupts.............................................................................................. 163 6.4.3 cmfa and cmfb ............................................................................................... 163 6.4.4 pc break interrupt when dtc and dmac is bus master .................................. 163
rev. 5.00 aug 08, 2006 page l of lx xxvi 6.4.5 pc break set for instruction fetch at address following bsr, jsr, jmp, trapa, rte, and rts instruction..................................................................... 163 6.4.6 i bit set by ldc, andc, orc, and xorc instruction..................................... 164 6.4.7 pc break set for instruction fetch at address following bcc instruction.......... 164 6.4.8 pc break set for instruction fetch at branch destination address of bcc instruction ............................................................................................................ 164 section 7 bus controller ................................................................................................... 165 7.1 features .................................................................................................................... ......... 165 7.2 input/output pins ........................................................................................................... ... 167 7.3 register descriptions ....................................................................................................... . 167 7.3.1 bus width control register (abwcr)............................................................... 168 7.3.2 access state control register (astcr) ............................................................. 168 7.3.3 wait control registers h and l (wcrh, wcrl).............................................. 169 7.3.4 bus control register h (bcrh) ......................................................................... 172 7.3.5 bus control register l (bcrl) .......................................................................... 173 7.3.6 pin function control register (pfcr) ................................................................ 174 7.4 bus control ................................................................................................................. ...... 175 7.4.1 area divisions ..................................................................................................... 175 7.4.2 bus specifications................................................................................................ 176 7.4.3 bus interface for each area................................................................................. 177 7.4.4 chip select signals .............................................................................................. 178 7.5 basic timing................................................................................................................ ..... 178 7.5.1 on-chip memory (rom, ram) access timing ................................................ 179 7.5.2 on-chip peripheral module access timing........................................................ 180 7.5.3 external address space access timing .............................................................. 181 7.6 basic bus interface ......................................................................................................... .. 181 7.6.1 data size and data alignment............................................................................. 181 7.6.2 valid strobes........................................................................................................ 182 7.6.3 basic timing........................................................................................................ 183 7.6.4 wait control ........................................................................................................ 190 7.7 burst rom interface......................................................................................................... 192 7.7.1 basic timing........................................................................................................ 192 7.7.2 wait control ........................................................................................................ 194 7.8 idle cycle .................................................................................................................. ........ 194 7.9 bus release................................................................................................................. ...... 197 7.9.1 bus release usage note ...................................................................................... 198 7.10 bus arbitration............................................................................................................ ...... 199 7.10.1 operation ............................................................................................................. 199 7.10.2 bus transfer timing ............................................................................................ 200
rev. 5.00 aug 08, 2006 page li of lx xxvi 7.10.3 external bus release usage note........................................................................ 200 7.11 resets and the bus controller ........................................................................................... 201 section 8 dma controller (dmac) ............................................................................. 203 8.1 features .................................................................................................................... ......... 203 8.2 input/output pins ........................................................................................................... ... 205 8.3 register descriptions ....................................................................................................... . 205 8.3.1 memory address registers (mara and marb) ............................................... 207 8.3.2 i/o address registers (ioara and ioarb) ...................................................... 207 8.3.3 execute transfer count registers (etcra and etcrb)................................... 208 8.3.4 dma control registers (dmacra and dmacrb) ......................................... 209 8.3.5 dma band control registers h and l (dmabcrh and dmabcrl)............. 218 8.3.6 dma write enable register (dmawer) .......................................................... 229 8.3.7 dma terminal control register (dmatcr)..................................................... 231 8.4 activation sources .......................................................................................................... .. 231 8.4.1 activation by internal interrupt request.............................................................. 232 8.4.2 activation by external request ........................................................................... 233 8.4.3 activation by auto-request................................................................................. 233 8.5 operation................................................................................................................... ........ 234 8.5.1 transfer modes .................................................................................................... 234 8.5.2 sequential mode .................................................................................................. 236 8.5.3 idle mode............................................................................................................. 239 8.5.4 repeat mode ........................................................................................................ 241 8.5.5 single address mode ........................................................................................... 244 8.5.6 normal mode ....................................................................................................... 248 8.5.7 block transfer mode ........................................................................................... 251 8.5.8 basic bus cycles.................................................................................................. 256 8.5.9 dma transfer (dual address mode) bus cycles ............................................... 257 8.5.10 dma transfer (single address mode) bus cycles............................................. 265 8.5.11 multi-channel operation ..................................................................................... 271 8.5.12 relation between dmac and external bus requests, and dtc ........................ 272 8.5.13 dmac and nmi interrupts.................................................................................. 272 8.5.14 forced termination of dmac operation............................................................ 273 8.5.15 clearing full address mode ................................................................................ 274 8.6 interrupt sources ........................................................................................................... .... 275 8.7 usage notes ................................................................................................................. ..... 276 8.7.1 dmac register access during operation........................................................... 276 8.7.2 module stop......................................................................................................... 277 8.7.3 medium-speed mode........................................................................................... 277 8.7.4 activation by falling edge on dreq pin ........................................................... 278
rev. 5.00 aug 08, 2006 page lii of lx xxvi 8.7.5 activation source acceptance ............................................................................. 278 8.7.6 internal interrupt after end of transfer................................................................ 278 8.7.7 channel re-setting .............................................................................................. 279 section 9 data transfer controller (dtc) ................................................................... 281 9.1 features .................................................................................................................... ......... 281 9.2 register descriptions ....................................................................................................... . 282 9.2.1 dtc mode register a (mra) ............................................................................ 283 9.2.2 dtc mode register b (mrb)............................................................................. 285 9.2.3 dtc source address register (sar).................................................................. 285 9.2.4 dtc destination address register (dar).......................................................... 285 9.2.5 dtc transfer count register a (cra) .............................................................. 286 9.2.6 dtc transfer count register b (crb)............................................................... 286 9.2.7 dtc enable registers a to g, and i (dtcera to dtcerg, and dtceri) .... 286 9.2.8 dtc vector register (dtvecr)........................................................................ 288 9.3 activation sources .......................................................................................................... .. 289 9.4 location of register information and dtc vector table ................................................ 290 9.5 operation ................................................................................................................... ....... 294 9.5.1 normal mode....................................................................................................... 295 9.5.2 repeat mode ........................................................................................................ 295 9.5.3 block transfer mode ........................................................................................... 296 9.5.4 chain transfer ..................................................................................................... 298 9.5.5 interrupts.............................................................................................................. 29 9 9.5.6 operation timing................................................................................................. 299 9.5.7 number of dtc execution states........................................................................ 301 9.6 procedures for using dtc................................................................................................ 302 9.6.1 activation by interrupt......................................................................................... 302 9.6.2 activation by software ........................................................................................ 302 9.7 examples of use of the dtc ............................................................................................ 303 9.7.1 normal mode....................................................................................................... 303 9.7.2 software activation ............................................................................................. 303 9.8 usage notes ................................................................................................................. ..... 304 9.8.1 module stop mode setting .................................................................................. 304 9.8.2 on-chip ram ..................................................................................................... 304 9.8.3 dtce bit setting................................................................................................. 304 section 10 i/o ports ............................................................................................................ 305 10.1 port 1..................................................................................................................... ............ 309 10.1.1 port 1 data direction register (p1ddr)............................................................. 309 10.1.2 port 1 data register (p1dr)................................................................................ 310
rev. 5.00 aug 08, 2006 page liii of lx xxvi 10.1.3 port 1 register (port1)...................................................................................... 310 10.1.4 pin functions ....................................................................................................... 311 10.2 port 3..................................................................................................................... ............ 315 10.2.1 port 3 data direction register (p3ddr)............................................................. 315 10.2.2 port 3 data register (p3dr)................................................................................ 316 10.2.3 port 3 register (port3)...................................................................................... 316 10.2.4 port 3 open drain control register (p3odr)..................................................... 317 10.2.5 pin functions ....................................................................................................... 317 10.3 port 4..................................................................................................................... ............ 321 10.3.1 port 4 register (port4)...................................................................................... 321 10.3.2 pin functions ....................................................................................................... 321 10.4 port 7..................................................................................................................... ............ 322 10.4.1 port 7 data direction register (p7ddr)............................................................. 322 10.4.2 port 7 data register (p7dr)................................................................................ 323 10.4.3 port 7 register (port7)...................................................................................... 323 10.4.4 pin functions ....................................................................................................... 324 10.5 port 9..................................................................................................................... ............ 327 10.5.1 port 9 register (port9)...................................................................................... 327 10.5.2 pin functions ....................................................................................................... 327 10.6 port a..................................................................................................................... ........... 328 10.6.1 port a data direction register (paddr) ........................................................... 328 10.6.2 port a data register (padr) .............................................................................. 328 10.6.3 port a register (porta) .................................................................................... 329 10.6.4 port a pull-up mos control register (papcr) ................................................ 329 10.6.5 port a open drain control register (paodr)................................................... 329 10.6.6 pin functions ....................................................................................................... 330 10.6.7 input pull-up mos states in port a.................................................................... 332 10.7 port b ..................................................................................................................... ........... 332 10.7.1 port b data direction register (pbddr)............................................................ 333 10.7.2 port b data register (pbdr) .............................................................................. 333 10.7.3 port b register (portb) .................................................................................... 334 10.7.4 port b pull-up mos control register (pbpcr)................................................. 334 10.7.5 pin functions ....................................................................................................... 334 10.7.6 input pull-up mos states in port b .................................................................... 339 10.8 port c ..................................................................................................................... ........... 339 10.8.1 port c data direction register (pcddr)............................................................ 340 10.8.2 port c data register (pcdr) .............................................................................. 340 10.8.3 port c register (portc) .................................................................................... 341 10.8.4 port c pull-up mos control register (pcpcr)................................................. 341 10.8.5 pin functions ....................................................................................................... 342
rev. 5.00 aug 08, 2006 page liv of lx xxvi 10.8.6 input pull-up mos states in port c.................................................................... 342 10.9 port d..................................................................................................................... ........... 343 10.9.1 port d data direction register (pdddr) ........................................................... 343 10.9.2 port d data register (pddr).............................................................................. 344 10.9.3 port d register (portd).................................................................................... 344 10.9.4 port d pull-up mos control register (pdpcr) ................................................ 345 10.9.5 pin functions ....................................................................................................... 345 10.9.6 input pull-up mos states in port d.................................................................... 346 10.10 port e .................................................................................................................... ............ 346 10.10.1 port e data direction register (peddr)............................................................ 347 10.10.2 port e data register (pedr)............................................................................... 347 10.10.3 port e register (porte)..................................................................................... 348 10.10.4 port e pull-up mos control register (pepcr) ................................................. 348 10.10.5 pin functions ....................................................................................................... 349 10.10.6 input pull-up mos states in port e .................................................................... 349 10.11 port f .................................................................................................................... ............ 350 10.11.1 port f data direction register (pfddr) ............................................................ 350 10.11.2 port f data register (pfdr) ............................................................................... 351 10.11.3 port f register (portf) ..................................................................................... 351 10.11.4 pin functions ....................................................................................................... 352 10.12 port g.................................................................................................................... ............ 354 10.12.1 port g data direction register (pgddr) ........................................................... 354 10.12.2 port g data register (pgdr).............................................................................. 355 10.12.3 port g register (portg).................................................................................... 355 10.12.4 pin functions ....................................................................................................... 355 section 11 16-bit timer pulse unit (tpu) .................................................................. 359 11.1 features ................................................................................................................... .......... 359 11.2 input/output pins .......................................................................................................... .... 364 11.3 register descriptions ...................................................................................................... .. 365 11.3.1 timer control register (tcr)............................................................................. 367 11.3.2 timer mode register (tmdr) ............................................................................ 372 11.3.3 timer i/o control register (tior) ..................................................................... 373 11.3.4 timer interrupt enable register (tier) .............................................................. 391 11.3.5 timer status register (tsr)................................................................................ 393 11.3.6 timer counter (tcnt)........................................................................................ 396 11.3.7 timer general register (tgr) ............................................................................ 396 11.3.8 timer start register (tstr) ............................................................................... 396 11.3.9 timer synchronous register (tsyr).................................................................. 397 11.4 operation .................................................................................................................. ........ 398
rev. 5.00 aug 08, 2006 page lv of lx xxvi 11.4.1 basic functions.................................................................................................... 398 11.4.2 synchronous operation........................................................................................ 403 11.4.3 buffer operation .................................................................................................. 405 11.4.4 cascaded operation ............................................................................................. 409 11.4.5 pwm modes ........................................................................................................ 411 11.4.6 phase counting mode .......................................................................................... 416 11.5 interrupt sources .......................................................................................................... ..... 423 11.6 dtc activation............................................................................................................. .... 425 11.7 dmac activation (h8s/2239 group only) ..................................................................... 425 11.8 a/d converter activation ................................................................................................. 42 6 11.9 operation timing........................................................................................................... ... 426 11.9.1 input/output timing ............................................................................................ 426 11.9.2 interrupt signal timing........................................................................................ 430 11.10 usage notes ............................................................................................................... ....... 433 11.10.1 module stop mode setting .................................................................................. 433 11.10.2 input clock restrictions....................................................................................... 433 11.10.3 caution on cycle setting ..................................................................................... 434 11.10.4 contention between tcnt write and clear operations ..................................... 434 11.10.5 contention between tcnt write and increment operations .............................. 435 11.10.6 contention between tgr write and compare match ......................................... 436 11.10.7 contention between buffer register write and compare match......................... 436 11.10.8 contention between tgr read and input capture.............................................. 437 11.10.9 contention between tgr write and input capture............................................. 438 11.10.10 contention between buffer register write and input capture ........................ 438 11.10.11 contention between overflow/underflow and counter clearing.................... 439 11.10.12 contention between tcnt write and overflow/underflow........................... 440 11.10.13 multiplexing of i/o pins .................................................................................. 440 11.10.14 interrupts and module stop mode ................................................................... 440 section 12 8-bit timers ..................................................................................................... 441 12.1 features ................................................................................................................... .......... 441 12.2 input/output pins .......................................................................................................... .... 443 12.3 register descriptions ...................................................................................................... .. 443 12.3.1 timer counter (tcnt)........................................................................................ 444 12.3.2 time constant register a (tcora)................................................................... 444 12.3.3 time constant register b (tcorb) ................................................................... 445 12.3.4 timer control register (tcr) ............................................................................. 445 12.3.5 timer control/status register (tcsr) ................................................................ 447 12.4 operation.................................................................................................................. ......... 452 12.4.1 pulse output......................................................................................................... 452
rev. 5.00 aug 08, 2006 page lvi of lx xxvi 12.5 operation timing........................................................................................................... ... 453 12.5.1 tcnt incrementation timing ............................................................................. 453 12.5.2 timing of cmfa and cmfb setting when a compare-match occurs............... 454 12.5.3 timing of timer output when a compare-match occurs ................................... 455 12.5.4 timing of compare-match clear when a compare-match occurs ..................... 455 12.5.5 tcnt external reset timing .............................................................................. 456 12.5.6 timing of overflow flag (ovf) setting ............................................................. 456 12.6 operation with cascaded connection ............................................................................... 457 12.6.1 16-bit count mode .............................................................................................. 457 12.6.2 compare-match count mode .............................................................................. 457 12.7 interrupt sources .......................................................................................................... ..... 458 12.7.1 interrupt sources and dtc activation ................................................................ 458 12.7.2 a/d converter activation.................................................................................... 458 12.8 usage notes ................................................................................................................ ...... 459 12.8.1 contention between tcnt write and clear........................................................ 459 12.8.2 contention between tcnt write and increment ................................................ 459 12.8.3 contention between tcor write and compare-match ...................................... 460 12.8.4 contention between compare-matches a and b................................................. 461 12.8.5 switching of internal clocks and tcnt operation............................................. 461 12.8.6 contention between interrupts and module stop mode ...................................... 463 12.8.7 mode setting of cascaded connection ................................................................ 463 section 13 watchdog timer (wdt) .............................................................................. 465 13.1 features ................................................................................................................... .......... 465 13.2 input/output pins .......................................................................................................... .... 467 13.3 register descriptions ...................................................................................................... .. 467 13.3.1 timer counter (tcnt)........................................................................................ 468 13.3.2 timer control/status register (tcsr)................................................................ 468 13.3.3 reset control/status register (rstcsr) (only wdt_0) ................................... 472 13.4 operation .................................................................................................................. ........ 473 13.4.1 watchdog timer mode ........................................................................................ 473 13.4.2 interval timer mode ............................................................................................ 474 13.4.3 timing of setting overflow flag (ovf) ............................................................. 475 13.4.4 timing of setting watchdog timer overflow flag (wovf) ............................. 476 13.5 interrupt sources .......................................................................................................... ..... 476 13.6 usage notes ................................................................................................................ ...... 477 13.6.1 notes on register access..................................................................................... 477 13.6.2 contention between timer counter (tcnt) write and increment ..................... 478 13.6.3 changing value of cks2 to cks0...................................................................... 479 13.6.4 switching between watchdog timer mode and interval timer mode................ 479
rev. 5.00 aug 08, 2006 page lvii of lx xxvi 13.6.5 internal reset in watchdog timer mode............................................................. 479 13.6.6 ovf flag clearing in interval timer mode ........................................................ 479 section 14 iebus ? controller (ieb) [h8s/2258 group] ....................................... 481 14.1 features ................................................................................................................... .......... 481 14.1.1 iebus communications protocol......................................................................... 483 14.1.2 communications protocol.................................................................................... 485 14.1.3 transfer data (data field contents) .................................................................... 493 14.1.4 bit format ............................................................................................................ 496 14.2 input/output pins .......................................................................................................... .... 497 14.3 register descriptions ...................................................................................................... .. 497 14.3.1 iebus control register (iectr) ......................................................................... 498 14.3.2 iebus command register (iecmr) ................................................................... 500 14.3.3 iebus master control register (iemcr)............................................................ 502 14.3.4 iebus master unit address register 1 (iear1) ................................................. 504 14.3.5 iebus master unit address register 2 (iear2) ................................................. 505 14.3.6 iebus slave address setting register 1 (iesa1)................................................ 505 14.3.7 iebus slave address setting register 2 (iesa2)................................................ 506 14.3.8 iebus transmit message length register (ietbfl).......................................... 506 14.3.9 iebus transmit buffer register (ietbr) ........................................................... 507 14.3.10 iebus reception master address register 1 (iema1) ....................................... 508 14.3.11 iebus reception master address register 2 (iema2) ....................................... 508 14.3.12 iebus receive control field register (ierctl)................................................ 509 14.3.13 iebus receive message length register (ierbfl) ........................................... 509 14.3.14 iebus receive buffer register (ierbr)............................................................. 510 14.3.15 iebus lock address register 1 (iela1) ............................................................ 511 14.3.16 iebus lock address register 2 (iela2) ............................................................ 511 14.3.17 iebus general flag register (ieflg)................................................................. 512 14.3.18 iebus transmit/runaway status register (ietsr) ............................................ 515 14.3.19 iebus transmit/runaway interrupt enable register (ieiet) ............................. 518 14.3.20 iebus transmit error flag register (ietef) ...................................................... 519 14.3.21 iebus receive status register (iersr).............................................................. 522 14.3.22 iebus receive interrupt enable register (ieier)............................................... 524 14.3.23 iebus receive error flag register (ieref) ....................................................... 524 14.4 operation descriptions..................................................................................................... . 527 14.4.1 master transmit operation .................................................................................. 527 14.4.2 slave receive operation...................................................................................... 529 14.4.3 master reception ................................................................................................. 533 14.4.4 slave transmission .............................................................................................. 536 14.5 interrupt sources .......................................................................................................... ..... 540
rev. 5.00 aug 08, 2006 page lviii of lx xxvi 14.6 usage notes ................................................................................................................ ...... 541 14.6.1 setting module stop mode .................................................................................. 541 14.6.2 txrdy flag and underrun error ........................................................................ 541 14.6.3 rxrdy flag and overrun error.......................................................................... 542 14.6.4 error flag s in the ietef..................................................................................... 542 14.6.5 error flags in ieref ........................................................................................... 543 14.6.6 notes on slave transmission............................................................................... 544 14.6.7 notes on dtc specification ................................................................................ 545 14.6.8 error handling in transmission........................................................................... 545 14.6.9 power-down mode operation ............................................................................. 546 14.6.10 notes on middle-speed mode ............................................................................. 546 14.6.11 notes on register access..................................................................................... 546 section 15 serial communication interface (sci) .................................................... 547 15.1 features ................................................................................................................... .......... 547 15.2 input/output pins .......................................................................................................... .... 551 15.3 register descriptions ...................................................................................................... .. 551 15.3.1 receive shift register (rsr) .............................................................................. 552 15.3.2 receive data register (rdr) .............................................................................. 552 15.3.3 transmit data register (tdr)............................................................................. 552 15.3.4 transmit shift register (tsr) ............................................................................. 553 15.3.5 serial mode register (smr)................................................................................ 553 15.3.6 serial control register (scr).............................................................................. 557 15.3.7 serial status register (ssr) ................................................................................ 563 15.3.8 smart card mode register (scmr) .................................................................... 570 15.3.9 bit rate register (brr) ...................................................................................... 571 15.3.10 serial expansion mode register (semr_0) ....................................................... 581 15.4 operation in asynchronous mode .................................................................................... 585 15.4.1 data transfer format........................................................................................... 585 15.4.2 receive data sampling timing and reception margin in asynchronous mode 587 15.4.3 clock.................................................................................................................... 588 15.4.4 sci initialization (asynchronous mode) ............................................................. 589 15.4.5 serial data transmission (asynchronous mode) ................................................ 590 15.4.6 serial data reception (asynchronous mode)...................................................... 592 15.5 multiprocessor communication function......................................................................... 596 15.5.1 multiprocessor serial data transmission ............................................................ 597 15.5.2 multiprocessor serial data reception ................................................................. 599 15.6 operation in clocked synchronous mode ........................................................................ 602 15.6.1 clock.................................................................................................................... 602 15.6.2 sci initialization (clocked synchronous mode) ................................................. 602
rev. 5.00 aug 08, 2006 page lix of lxxxvi 15.6.3 serial data transmission (clocked synchronous mode) .................................... 603 15.6.4 serial data reception (clocked synchronous mode).......................................... 606 15.6.5 simultaneous serial data transmission and reception (clocked synchronous mode) ............................................................................. 608 15.7 operation in smart card interface .................................................................................... 610 15.7.1 pin connection example...................................................................................... 610 15.7.2 data format (except for block transfer mode) .................................................. 610 15.7.3 block transfer mode ........................................................................................... 612 15.7.4 receive data sampling timing and reception margin....................................... 612 15.7.5 initialization ......................................................................................................... 61 3 15.7.6 serial data transmission (except for block transfer mode).............................. 614 15.7.7 serial data reception (except for block transfer mode) ................................... 617 15.7.8 clock output control........................................................................................... 618 15.8 sci select function (h8s/2239 group only)................................................................... 620 15.9 interrupt sources .......................................................................................................... ..... 622 15.9.1 interrupts in normal serial communication interface mode............................... 622 15.9.2 interrupts in smart card interface mode ............................................................. 624 15.10 usage notes ............................................................................................................... ....... 625 15.10.1 module stop mode setting .................................................................................. 625 15.10.2 break detection and processing (asynchronous mode only)............................. 625 15.10.3 mark state and break detection (asynchronous mode only)............................. 625 15.10.4 receive error flags and transmit operations (clocked synchronous mode only)..................................................................... 625 15.10.5 restrictions on use of dmac or dtc................................................................ 626 15.10.6 operation in case of mode transition................................................................. 626 15.10.7 switching from sck pin function to port pin function ..................................... 630 15.10.8 assignment and selection of registers................................................................ 631 section 16 i 2 c bus interface (iic) (option) ................................................................ 633 16.1 features ................................................................................................................... .......... 633 16.2 input/output pins .......................................................................................................... .... 636 16.3 register descriptions ...................................................................................................... .. 636 16.3.1 i 2 c bus data register (icdr) ............................................................................. 637 16.3.2 slave address register (sar) ............................................................................. 639 16.3.3 second slave address register (sarx) ............................................................. 639 16.3.4 i 2 c bus mode register (icmr)........................................................................... 640 16.3.5 serial control register x (scrx)....................................................................... 643 16.3.6 i 2 c bus control register (iccr)......................................................................... 644 16.3.7 i 2 c bus status register (icsr)............................................................................ 649 16.3.8 ddc switch register (ddcswr) ...................................................................... 653
rev. 5.00 aug 08, 2006 page lx of l xxxvi 16.4 operation .................................................................................................................. ........ 653 16.4.1 i 2 c bus data format............................................................................................ 653 16.4.2 initial setting........................................................................................................ 65 5 16.4.3 master transmit operation .................................................................................. 655 16.4.4 master receive operation.................................................................................... 659 16.4.5 slave receive operation...................................................................................... 664 16.4.6 slave transmit operation .................................................................................... 669 16.4.7 iric setting timing and scl control ................................................................ 672 16.4.8 operation using the dtc .................................................................................... 673 16.4.9 noise canceler..................................................................................................... 674 16.4.10 initialization of internal state .............................................................................. 674 16.5 interrupt source ........................................................................................................... ..... 676 16.6 usage notes ................................................................................................................ ...... 676 16.6.1 module stop mode setting .................................................................................. 687 section 17 a/d converter ................................................................................................. 689 17.1 features ................................................................................................................... .......... 689 17.2 input/output pins .......................................................................................................... .... 691 17.3 register descriptions ...................................................................................................... .. 692 17.3.1 a/d data registers a to d (addra to addrd) ............................................. 692 17.3.2 a/d control/status register (adcsr) ............................................................... 693 17.3.3 a/d control register (adcr) ............................................................................ 695 17.4 interface to bus master .................................................................................................... . 696 17.5 operation .................................................................................................................. ........ 697 17.5.1 single mode......................................................................................................... 697 17.5.2 scan mode ........................................................................................................... 698 17.5.3 input sampling and a/d conversion time ......................................................... 699 17.5.4 external trigger input timing............................................................................. 701 17.6 interrupt source ........................................................................................................... ..... 701 17.7 a/d conversion accuracy definitions ............................................................................. 702 17.8 usage notes ................................................................................................................ ...... 704 17.8.1 module stop mode setting .................................................................................. 704 17.8.2 permissible signal source impedance ................................................................. 704 17.8.3 influences on absolute accuracy ........................................................................ 704 17.8.4 range of analog power supply and other pin settings ...................................... 705 17.8.5 notes on board design ........................................................................................ 705 17.8.6 notes on noise countermeasures ........................................................................ 705 section 18 d/a converter ................................................................................................. 707 18.1 features ................................................................................................................... .......... 707
rev. 5.00 aug 08, 2006 page lxi of lxxxvi 18.2 input/output pins .......................................................................................................... .... 708 18.3 register description....................................................................................................... ... 708 18.3.1 d/a data registers 0 and 1 (dadr0 and dadr1)............................................ 708 18.3.2 d/a control register (dacr)............................................................................. 709 18.4 operation.................................................................................................................. ......... 710 18.5 usage notes ................................................................................................................ ...... 711 18.5.1 analog power supply current in power-down mode......................................... 711 18.5.2 setting for module stop mode............................................................................. 711 section 19 ram .................................................................................................................. 713 section 20 flash memory (f-ztat version) ............................................................ 715 20.1 features ................................................................................................................... .......... 715 20.2 mode transitions ........................................................................................................... ... 716 20.3 block configuration........................................................................................................ .. 720 20.4 input/output pins .......................................................................................................... .... 724 20.5 register descriptions ...................................................................................................... .. 724 20.5.1 flash memory control register 1 (flmcr1)..................................................... 725 20.5.2 flash memory control register 2 (flmcr2)..................................................... 726 20.5.3 erase block register 1 (ebr1) ........................................................................... 726 20.5.4 erase block register 2 (ebr2) ........................................................................... 728 20.5.5 ram emulation register (ramer)................................................................... 729 20.5.6 flash memory power control register (flpwcr) ............................................ 731 20.5.7 serial control register x (scrx)....................................................................... 731 20.6 on-board programming modes ........................................................................................ 732 20.6.1 boot mode ........................................................................................................... 732 20.6.2 programming/erasing in user program mode..................................................... 735 20.7 flash memory emulation in ram.................................................................................... 735 20.8 flash memory programming/erasing ............................................................................... 737 20.8.1 program/program-verify ..................................................................................... 738 20.8.2 erase/erase-verify............................................................................................... 740 20.9 program/erase protection.................................................................................................. 7 42 20.9.1 hardware protection ............................................................................................ 742 20.9.2 software protection.............................................................................................. 742 20.9.3 error protection.................................................................................................... 742 20.10 interrupt handling when programming/erasing flash memory ...................................... 743 20.11 programmer mode ........................................................................................................... . 743 20.12 power-down states for flash memory............................................................................. 745 20.13 flash memory programming and erasing precautions ..................................................... 745 20.14 note on switching from f-ztat version to masked rom version............................... 751
rev. 5.00 aug 08, 2006 page lxii of lx xxvi section 21 masked rom .................................................................................................. 753 21.1 features ................................................................................................................... .......... 753 section 22 prom ................................................................................................................ 755 22.1 prom mode setting......................................................................................................... 7 55 22.2 socket adapter and memory map .................................................................................... 755 22.3 programming................................................................................................................ ..... 759 22.3.1 programming and verification............................................................................. 759 22.3.2 programming precautions .................................................................................... 763 22.3.3 reliability of programmed data .......................................................................... 764 section 23 clock pulse generator .................................................................................. 765 23.1 register descriptions ...................................................................................................... .. 766 23.1.1 system clock control register (sckcr) ........................................................... 766 23.1.2 low-power control register (lpwrcr) ........................................................... 768 23.2 system clock oscillator.................................................................................................... 770 23.2.1 connecting a crystal resonator........................................................................... 770 23.2.2 external clock input ............................................................................................ 771 23.2.3 notes on switching external clock ..................................................................... 777 23.3 duty adjustment circuit................................................................................................... 7 79 23.4 medium-speed clock divider .......................................................................................... 779 23.5 bus master clock selection circuit .................................................................................. 779 23.6 system clock when using iebus ..................................................................................... 779 23.7 subclock oscillator ........................................................................................................ ... 780 23.7.1 connecting 32.768-khz crystal resonator.......................................................... 780 23.7.2 handling pins when subclock not required....................................................... 781 23.8 subclock waveform generation circuit ........................................................................... 781 23.9 usage notes ................................................................................................................ ...... 781 23.9.1 note on crystal resonator ................................................................................... 781 23.9.2 note on board design.......................................................................................... 782 section 24 power-down modes ...................................................................................... 783 24.1 register description....................................................................................................... ... 787 24.1.1 standby control register (sbycr) .................................................................... 787 24.1.2 module stop control registers a to c (mstpcra to mstpcrc)................... 789 24.2 medium-speed mode........................................................................................................ 79 0 24.3 sleep mode ................................................................................................................. ...... 791 24.3.1 transition to sleep mode..................................................................................... 791 24.3.2 exiting sleep mode ............................................................................................. 792 24.4 software standby mode.................................................................................................... 79 2
rev. 5.00 aug 08, 2006 page lxiii of lx xxvi 24.4.1 transition to software standby mode ................................................................. 792 24.4.2 clearing software standby mode ........................................................................ 792 24.4.3 oscillation settling time after clearing software standby mode....................... 793 24.4.4 software standby mode application example .................................................... 794 24.5 hardware standby mode................................................................................................... 795 24.5.1 transition to hardware standby mode ................................................................ 795 24.5.2 clearing hardware standby mode....................................................................... 795 24.5.3 hardware standby mode timing......................................................................... 795 24.6 module stop mode........................................................................................................... . 796 24.7 watch mode................................................................................................................. ..... 797 24.7.1 transition to watch mode ................................................................................... 797 24.7.2 exiting watch mode ............................................................................................ 797 24.8 subsleep mode.............................................................................................................. .... 798 24.8.1 transition to subsleep mode ............................................................................... 798 24.8.2 exiting subsleep mode ........................................................................................ 798 24.9 subactive mode............................................................................................................. .... 799 24.9.1 transition to subactive mode .............................................................................. 799 24.9.2 exiting subactive mode....................................................................................... 799 24.10 direct transitions........................................................................................................ ...... 800 24.10.1 direct transitions from high-speed mode to subactive mode........................... 800 24.10.2 direct transitions from subactive mode to high-speed mode........................... 800 24.11 clock output enable...................................................................................................... 800 24.12 usage notes ............................................................................................................... ....... 801 24.12.1 i/o port status...................................................................................................... 801 24.12.2 current dissipation during oscillation settling wait period ............................... 801 24.12.3 dtc and dmac module stop ............................................................................ 801 24.12.4 on-chip peripheral module interrupt .................................................................. 801 24.12.5 writing to mstpcr ............................................................................................ 802 24.12.6 entering subactive/watch mode and dmac and dtc module stop ................ 802 section 25 power supply circuit .................................................................................... 803 25.1 overview................................................................................................................... ........ 803 25.2 power supply connection for h8s/2258 group, h8s/2238b, and h8s/2236b (on-chip internal power supply step-down circuit) ...................................................... 803 25.3 power supply connection for h8s/2239 group, h8s/2238r, h8s/2236r, h8s/2237 group, and h8s/2227 group (no internal power supply step-down circuit) ................ 804 25.4 note on bypass capacitor................................................................................................. 80 5 section 26 list of registers .............................................................................................. 807 26.1 register addresses (in address order)............................................................................. 807
rev. 5.00 aug 08, 2006 page lxiv of l xxxvi 26.2 register bits.............................................................................................................. ........ 818 26.3 register states in each operating mode........................................................................... 830 section 27 electrical characteristics .............................................................................. 839 27.1 power supply voltage and operating frequency range .................................................. 839 27.2 electrical characteristics of h8s/2258 group .................................................................. 844 27.2.1 absolute maximum ratings ................................................................................ 844 27.2.2 dc characteristics ............................................................................................... 845 27.2.3 ac characteristics ............................................................................................... 853 27.2.4 a/d conversion characteristics........................................................................... 860 27.2.5 d/a conversion characteristics........................................................................... 861 27.2.6 flash memory characteristics ............................................................................. 862 27.3 electrical characteristics of h8s/2239 group .................................................................. 864 27.3.1 absolute maximum ratings ................................................................................ 864 27.3.2 dc characteristics ............................................................................................... 865 27.3.3 ac characteristics ............................................................................................... 873 27.3.4 a/d conversion characteristics........................................................................... 883 27.3.5 d/a conversion characteristics........................................................................... 884 27.3.6 flash memory characteristics ............................................................................. 885 27.4 electrical characteristics of h8s/2238b and h8s/2236b ................................................ 887 27.4.1 absolute maximum ratings ................................................................................ 887 27.4.2 dc characteristics ............................................................................................... 888 27.4.3 ac characteristics ............................................................................................... 896 27.4.4 a/d conversion characteristics........................................................................... 904 27.4.5 d/a conversion characteristics........................................................................... 904 27.4.6 flash memory characteristics ............................................................................. 905 27.5 electrical characteristics of h8s/2238r and h8s/2236r ................................................ 907 27.5.1 absolute maximum ratings ................................................................................ 907 27.5.2 dc characteristics ............................................................................................... 908 27.5.3 ac characteristics ............................................................................................... 915 27.5.4 a/d conversion characteristics........................................................................... 923 27.5.5 d/a conversion characteristics........................................................................... 924 27.5.6 flash memory characteristics ............................................................................. 925 27.6 electrical characteristics of h8s/2237 group and h8s/2227 group ............................... 927 27.6.1 absolute maximum ratings ................................................................................ 927 27.6.2 dc characteristics ............................................................................................... 928 27.6.3 ac characteristics ............................................................................................... 937 27.6.4 a/d conversion characteristics........................................................................... 944 27.6.5 d/a conversion characteristics........................................................................... 945 27.6.6 flash memory characteristics ............................................................................. 946
rev. 5.00 aug 08, 2006 page lxv of lxxxvi 27.7 operating timing........................................................................................................... ... 948 27.7.1 clock timing ....................................................................................................... 948 27.7.2 control signal timing ......................................................................................... 949 27.7.3 bus timing........................................................................................................... 950 27.7.4 timing of on-chip peripheral modules .............................................................. 957 27.8 usage note................................................................................................................. ....... 961 appendix a i/o port states in each pin state ............................................................ 963 a.1 i/o port state in each pin state ........................................................................................ 963 appendix b product codes ............................................................................................... 968 appendix c package dimensions ................................................................................... 973 index ............................................................................................................................. 97 9
rev. 5.00 aug 08, 2006 page lxvi of l xxxvi figures section 1 overview figure 1.1 internal block diagram of h8s/2258 group ......................................................... 4 figure 1.2 internal block diagram of h8s/2239 group ......................................................... 5 figure 1.3 internal block diagram of h8s/2238 group ......................................................... 6 figure 1.4 internal block diagram of h8s/2237 group ......................................................... 7 figure 1.5 internal block diagram of h8s/2227 group ......................................................... 8 figure 1.6 pin arrangement of h8s/2258 group (tfp-100b, tfp-100bv, fp-100b, fp-100bv: top view) ........................................................................................... 9 figure 1.7 pin arrangement of h8s/2258 group (fp-100a, fp-100av: top view) ............ 10 figure 1.8 pin arrangement of h8s/2239 group (tfp-100b, tfp-100bv, tfp-100g, tfp-100gv, fp-100b, fp-100bv: top view)..................................................... 11 figure 1.9 pin arrangement of h8s/2239 group (tbp-112a, tbp-112av: top view, only for hd64f2239)............................................................................................ 12 figure 1.10 pin arrangement of h8s/2238 group (tfp-100b, tfp-100bv, tfp-100g, tfp-100gv, fp-100b, fp-100bv: top view)..................................................... 13 figure 1.11 pin arrangement of h8s/2238 group (fp-100a, fp-100av: top view, only for h8s/2238b and h8s/2236b) .................................................................. 14 figure 1.12 pin arrangement of h8s/2238 group (bp-112, bp-112v, tbp-112a, tbp-112av: top view, only for hd64f2238r)................................................. 15 figure 1.13 pin arrangement of h8s/2237 group (tfp-100b, tfp-100bv, tfp-100g, tfp-100gv, fp-100b, fp-100bv: top view)..................................................... 16 figure 1.14 pin arrangement of h8s/2237 group (fp-100a, fp-100av: top view) ............ 17 figure 1.15 pin arrangement of h8s/2227 group (tfp-100b, tfp-100bv, tfp-100g, tfp-100gv, fp-100b, fp-100bv: top view)..................................................... 18 figure 1.16 pin arrangement of h8s/2227 group (fp-100a, fp-100av: top view, only for hd6432227) ............................................................................................ 19 section 2 cpu figure 2.1 exception vector table (normal mode)................................................................ 67 figure 2.2 stack structure in normal mode............................................................................ 67 figure 2.3 exception vector table (advanced mode)............................................................ 68 figure 2.4 stack structure in advanced mode........................................................................ 69 figure 2.5 memory map.......................................................................................................... 7 0 figure 2.6 cpu registers ........................................................................................................ 71 figure 2.7 usage of general registers .................................................................................... 72 figure 2.8 stack status ......................................................................................................... ... 73 figure 2.9 general register data formats (1)......................................................................... 76
rev. 5.00 aug 08, 2006 page lxvii of lxxxvi figure 2.9 general register data formats (2)......................................................................... 77 figure 2.10 memory data formats............................................................................................ 78 figure 2.11 instruction formats (examples) ............................................................................. 90 figure 2.12 branch address specification in memory indirect mode ...................................... 93 figure 2.13 state transitions ................................................................................................... .. 97 figure 2.14 flowchart for access methods for registers that include write-only bits.......... 101 section 3 mcu operating modes figure 3.1 h8s/2258 memory map in each operating mode................................................. 109 figure 3.2 h8s/2256 memory map in each operating mode................................................. 110 figure 3.3 h8s/2239 memory map in each operating mode................................................. 111 figure 3.4 h8s/2238b and h8s/2238r memory map in each operating mode ................... 112 figure 3.5 h8s/2236b and h8s/2236r memory map in each operating mode ................... 113 figure 3.6 h8s/2237 and h8s/2227 memory map in each operating mode......................... 114 figure 3.7 h8s/2235 and h8s/2225 memory map in each operating mode......................... 115 figure 3.8 h8s/2224 memory map in each operating mode................................................. 116 figure 3.9 h8s/2233 and h8s/2223 memory map in each operating mode......................... 117 section 4 exception handling figure 4.1 reset sequence (mode 4)....................................................................................... 122 figure 4.2 stack status after exception handling (advanced mode) ..................................... 125 figure 4.3 operation when sp value is odd.......................................................................... 126 section 5 interrupt controller figure 5.1 block diagram of interrupt controller................................................................... 128 figure 5.2 block diagram of irqn interrupts......................................................................... 135 figure 5.3 set timing for irqnf ............................................................................................ 136 figure 5.4 block diagram of interrupt control operation ...................................................... 143 figure 5.5 flowchart of procedure up to interrupt acceptance in interrupt control mode 0. 146 figure 5.6 flowchart of procedure up to interrupt acceptance in control mode 2 ............... 148 figure 5.7 interrupt exception handling ................................................................................. 149 figure 5.8 dtc and dmac interrupt control ........................................................................ 152 figure 5.9 contention between interrupt generation and disabling ....................................... 155 section 6 pc break controller (pbc) figure 6.1 block diagram of pc break controller ................................................................. 158 figure 6.2 operation in power-down mode transitions......................................................... 162 section 7 bus controller figure 7.1 block diagram of bus controller........................................................................... 166
rev. 5.00 aug 08, 2006 page lxviii of l xxxvi figure 7.2 overview of area divisions................................................................................... 175 figure 7.3 csn signal output timing (n = 0 to 7) .................................................................. 178 figure 7.4 on-5chip memory access cycle........................................................................... 179 figure 7.5 pin states during on-chip memory access........................................................... 179 figure 7.6 on-chip peripheral module access cycle............................................................. 180 figure 7.7 pin states during on-chip peripheral module access........................................... 180 figure 7.8 access sizes and data alignment control (8-bit access space) .......................... 181 figure 7.9 access sizes and data alignment control (16-bit access space) ........................ 182 figure 7.10 bus timing for 8-bit 2-state access space ........................................................... 183 figure 7.11 bus timing for 8-bit 3-state access space ........................................................... 184 figure 7.12 bus timing for 16-bit 2-state access space (1) (even address byte access) ..... 185 figure 7.13 bus timing for 16-bit 2-state access space (2) (odd address byte access) ...... 186 figure 7.14 bus timing for 16-bit 2-state access space (3) (word access)........................... 187 figure 7.15 bus timing for 16-bit 3-state access space (1) (even address byte access) ..... 188 figure 7.16 bus timing for 16-bit 3-state access space (2) (odd address byte access) ...... 189 figure 7.17 bus timing for 16-bit 3-state access space (3) (word access)........................... 190 figure 7.18 example of wait state insertion timing................................................................ 191 figure 7.19 example of burst rom access timing (when ast0 = brsts1 = 1)................. 193 figure 7.20 example of burst rom access timing (when ast0 = brsts1 = 0)................. 193 figure 7.21 example of idle cycle operation (1) ..................................................................... 194 figure 7.22 example of idle cycle operation (2) ..................................................................... 195 figure 7.23 relationship between chip select ( cs ) and read ( rd ) ........................................ 196 figure 7.24 bus-released state transition timing................................................................... 198 section 8 dma controller (dmac) figure 8.1 block diagram of dmac ...................................................................................... 204 figure 8.2 areas for register re-setting by dtc (channel 0a) ............................................ 230 figure 8.3 operation in sequential mode................................................................................ 237 figure 8.4 example of sequential mode setting procedure.................................................... 238 figure 8.5 operation in idle mode .......................................................................................... 239 figure 8.6 example of idle mode setting procedure .............................................................. 240 figure 8.7 operation in repeat mode...................................................................................... 242 figure 8.8 example of repeat mode setting procedure.......................................................... 243 figure 8.9 data bus in single address mode.......................................................................... 244 figure 8.10 operation in single address mode (when sequential mode is specified) ............ 246 figure 8.11 example of single address mode setting procedure (when sequential mode is specified) ........................................................................................................... 247 figure 8.12 operation in normal mode .................................................................................... 249 figure 8.13 example of normal mode setting procedure......................................................... 250 figure 8.14 operation in block transfer mode (blkdir = 0)................................................ 252
rev. 5.00 aug 08, 2006 page lxix of l xxxvi figure 8.15 operation in block transfer mode (blkdir = 1) ................................................ 253 figure 8.16 operation flow in block transfer mode ............................................................... 254 figure 8.17 example of block transfer mode setting procedure............................................. 255 figure 8.18 example of dma transfer bus timing................................................................. 256 figure 8.19 example of short address mode transfer ............................................................. 257 figure 8.20 example of full address mode transfer (cycle steal) ......................................... 258 figure 8.21 example of full address mode transfer (burst mode)......................................... 259 figure 8.22 example of full address mode transfer (block transfer mode) ......................... 260 figure 8.23 example of dreq pin falling edge activated normal mode transfer................ 261 figure 8.24 example of dreq pin falling edge activated block transfer mode transfer.... 262 figure 8.25 example of dreq pin low level activated normal mode transfer................... 263 figure 8.26 example of dreq pin low level activated block transfer mode transfer ....... 264 figure 8.27 example of single address mode transfer (byte read) ....................................... 265 figure 8.28 example of single address mode (word read) transfer...................................... 266 figure 8.29 example of single address mode transfer (byte write) ...................................... 267 figure 8.30 example of single address mode transfer (word write)..................................... 268 figure 8.31 example of dreq pin falling edge activated single address mode transfer.... 269 figure 8.32 example of dreq pin low level activated single address mode transfer....... 270 figure 8.33 example of multi-channel transfer....................................................................... 272 figure 8.34 example of procedure for continuing transfer on channel interrupted by nmi interrupt.................................................................................................................. 273 figure 8.35 example of procedure for forcibly terminating dmac operation...................... 274 figure 8.36 example of procedure for clearing full address mode ........................................ 274 figure 8.37 block diagram of transfer end/transfer break interrupt ..................................... 275 figure 8.38 dmac register update timing............................................................................. 276 figure 8.39 contention between dmac register update and cpu read................................ 277 section 9 data transfer controller (dtc) figure 9.1 block diagram of dtc .......................................................................................... 282 figure 9.2 block diagram of dtc activation source control ............................................... 290 figure 9.3 the location of the dtc register information in the address space................... 291 figure 9.4 correspondence between dtc vector address and register information ............ 291 figure 9.5 flowchart of dtc operation.................................................................................. 294 figure 9.6 memory mapping in normal mode ....................................................................... 295 figure 9.7 memory mapping in repeat mode ........................................................................ 296 figure 9.8 memory mapping in block transfer mode ........................................................... 297 figure 9.9 chain transfer operation ....................................................................................... 298 figure 9.10 dtc operation timing (example in normal mode or repeat mode) .................. 299 figure 9.11 dtc operation timing (example of block transfer mode, with block size of 2) ................................................................................................................ 300
rev. 5.00 aug 08, 2006 page lxx of l xxxvi figure 9.12 dtc operation timing (example of chain transfer) ........................................... 300 section 10 i/o ports figure 10.1 types of open drain outputs ................................................................................ 318 section 11 16-bit timer pulse unit (tpu) figure 11.1 block diagram of tpu (h8s/2258 group, h8s/2239 group, h8s/2238 group, and h8s/2237 group) ............................................................................................ 362 figure 11.2 block diagram of tpu (h8s/2227 group)............................................................ 363 figure 11.3 example of counter operation setting procedure ................................................. 398 figure 11.4 free-running counter operation........................................................................... 399 figure 11.5 periodic counter operation.................................................................................... 400 figure 11.6 example of setting procedure for waveform output by compare match............. 400 figure 11.7 example of 0 output/1 output operation .............................................................. 401 figure 11.8 example of toggle output operation .................................................................... 401 figure 11.9 example of setting procedure for input capture operation................................... 402 figure 11.10 example of input capture operation ..................................................................... 403 figure 11.11 example of synchronous operation setting procedure ......................................... 404 figure 11.12 example of synchronous operation....................................................................... 405 figure 11.13 compare match buffer operation.......................................................................... 406 figure 11.14 input capture buffer operation.............................................................................. 406 figure 11.15 example of buffer operation setting procedure.................................................... 407 figure 11.16 example of buffer operation (1) ........................................................................... 408 figure 11.17 example of buffer operation (2) ........................................................................... 409 figure 11.18 cascaded operation setting procedure .................................................................. 410 figure 11.19 example of cascaded operation (1)....................................................................... 410 figure 11.20 example of cascaded operation (2)....................................................................... 411 figure 11.21 example of pwm mode setting procedure ........................................................... 413 figure 11.22 example of pwm mode operation (1) .................................................................. 414 figure 11.23 example of pwm mode operation (2) .................................................................. 414 figure 11.24 example of pwm mode operation (3) .................................................................. 415 figure 11.25 example of phase counting mode setting procedure............................................ 417 figure 11.26 example of phase counting mode 1 operation ..................................................... 417 figure 11.27 example of phase counting mode 2 operation ..................................................... 419 figure 11.28 example of phase counting mode 3 operation ..................................................... 420 figure 11.29 example of phase counting mode 4 operation ..................................................... 421 figure 11.30 phase counting mode application example.......................................................... 422 figure 11.31 count timing in internal clock operation............................................................. 426 figure 11.32 count timing in external clock operation ........................................................... 427 figure 11.33 output compare output timing ............................................................................ 427
rev. 5.00 aug 08, 2006 page lxxi of l xxxvi figure 11.34 input capture input signal timing......................................................................... 428 figure 11.35 counter clear timing (compare match) ............................................................... 428 figure 11.36 counter clear timing (input capture) ................................................................... 429 figure 11.37 buffer operation timing (compare match)........................................................... 429 figure 11.38 buffer operation timing (input capture) .............................................................. 430 figure 11.39 tgi interrupt timing (compare match) ................................................................ 430 figure 11.40 tgi interrupt timing (input capture) .................................................................... 431 figure 11.41 tciv interrupt setting timing............................................................................... 431 figure 11.42 tciu interrupt setting timing............................................................................... 432 figure 11.43 timing for status flag clearing by cpu ............................................................... 432 figure 11.44 timing for status flag clearing by dtc/dmac activation ................................ 433 figure 11.45 phase difference, overlap, and pulse width in phase counting mode ................. 434 figure 11.46 contention between tcnt write and clear operations........................................ 435 figure 11.47 contention between tcnt write and increment operations ................................ 435 figure 11.48 contention between tgr write and compare match............................................ 436 figure 11.49 contention between buffer register write and compare match........................... 437 figure 11.50 contention between tgr read and input capture ................................................ 437 figure 11.51 contention between tgr write and input capture ............................................... 438 figure 11.52 contention between buffer register write and input capture............................... 439 figure 11.53 contention between overflow and counter clearing............................................. 439 figure 11.54 contention between tcnt write and overflow.................................................... 440 section 12 8-bit timers figure 12.1 block diagram of 8-bit timer module.................................................................. 442 figure 12.2 example of pulse output........................................................................................ 453 figure 12.3 count timing for internal clock input................................................................... 453 figure 12.4 count timing for external clock input ................................................................. 454 figure 12.5 timing of cmf setting .......................................................................................... 454 figure 12.6 timing of timer output ......................................................................................... 455 figure 12.7 timing of compare-match clear ........................................................................... 455 figure 12.8 timing of clearing by external reset input........................................................... 456 figure 12.9 timing of ovf setting........................................................................................... 456 figure 12.10 contention between tcnt write and clear .......................................................... 459 figure 12.11 contention between tcnt write and increment................................................... 460 figure 12.12 contention between tcor write and compare-match......................................... 460 section 13 watchdog timer (wdt) figure 13.1 block diagram of wdt_0 (1) ............................................................................... 466 figure 13.1 block diagram of wdt_1 (2) ............................................................................... 467 figure 13.2 watchdog timer mode operation.......................................................................... 474
rev. 5.00 aug 08, 2006 page lxxii of l xxxvi figure 13.3 interval timer mode operation ............................................................................. 475 figure 13.4 timing of ovf setting........................................................................................... 475 figure 13.5 timing of wovf setting....................................................................................... 476 figure 13.6 writing to tcnt, tcsr ........................................................................................ 477 figure 13.7 writing to rstcsr ............................................................................................... 478 figure 13.8 contention between tcnt write and increment................................................... 478 section 14 iebus ? ? ? ? controller (ieb) [h8s/2258 group] figure 14.1 block diagram of ieb............................................................................................ 482 figure 14.2 transfer signal format........................................................................................... 486 figure 14.3 bit configuration of slave status (ssr) ................................................................ 494 figure 14.4 locked address configuration............................................................................... 495 figure 14.5 iebus bit format (conceptual diagram)............................................................... 496 figure 14.6 transmission signal format and registers in data transfer ................................. 507 figure 14.7 relationship between transmission signal format and registers in iebus data reception ....................................................................................................... 510 figure 14.8 master transmit operation timing........................................................................ 529 figure 14.9 slave reception operation timing ........................................................................ 532 figure 14.10 error occurrence in the broadcast reception (dee = 1)....................................... 533 figure 14.11 master receive operation timing ......................................................................... 536 figure 14.12 slave transmit operation timing .......................................................................... 539 figure 14.13 relationships among transfer interrupt sources ................................................... 540 figure 14.14 relationships among receive interrupt sources .................................................... 540 figure 14.15 error processing in transfer................................................................................... 545 section 15 serial communication interface (sci) figure 15.1 block diagram of sci............................................................................................ 549 figure 15.2 block diagram of sci_0 of h8s/2239 group ....................................................... 550 figure 15.3 example of the internal base clock when the average transfer rate is selected (1)......................................................................................................... 583 figure 15.4 example of the internal base clock when the average transfer rate is selected (2)......................................................................................................... 584 figure 15.5 data format in asynchronous communication (example with 8-bit data, parity, two stop bits)............................................................................................ 585 figure 15.6 receive data sampling timing in asynchronous mode ....................................... 588 figure 15.7 relationship between output clock and transfer data phase (asynchronous mode)............................................................................................ 588 figure 15.8 sample sci initialization flowchart ...................................................................... 589 figure 15.9 example of operation in transmission in asynchronous mode (example with 8-bit data, parity, one stop bit) ........................................................................... 590
rev. 5.00 aug 08, 2006 page lxxiii of l xxxvi figure 15.10 sample serial transmission flowchart .................................................................. 591 figure 15.11 example of sci operation in reception (example with 8-bit data, parity, one stop bit) 592 figure 15.12 sample serial reception data flowchart (1) ......................................................... 594 figure 15.12 sample serial reception data flowchart (2) ......................................................... 595 figure 15.13 example of communication using multiprocessor format (transmission of data h'aa to receiving station a) ....................................................................... 597 figure 15.14 sample multiprocessor serial transmission flowchart ......................................... 598 figure 15.15 example of sci operation in reception (example with 8-bit data, multiprocessor bit, one stop bit).......................................................................... 599 figure 15.16 sample multiprocessor serial reception flowchart (1)......................................... 600 figure 15.16 sample multiprocessor serial reception flowchart (2)......................................... 601 figure 15.17 data format in synchronous communication (for lsb-first) ............................. 602 figure 15.18 sample sci initialization flowchart ...................................................................... 603 figure 15.19 sample sci transmission operation in clocked synchronous mode ................... 604 figure 15.20 sample serial transmission flowchart .................................................................. 605 figure 15.21 example of sci operation in reception ................................................................ 606 figure 15.22 sample serial reception flowchart ....................................................................... 607 figure 15.23 sample flowchart of simultaneous serial transmit and receive operations ....... 609 figure 15.24 schematic diagram of smart card interface pin connections............................... 610 figure 15.25 normal smart card interface data format ............................................................ 611 figure 15.26 direct convention (sdir = sinv = o/ e = 0) ....................................................... 611 figure 15.27 inverse convention (sdir = sinv = o/ e = 1)...................................................... 611 figure 15.28 receive data sampling timing in smart card mode (using clock of 372 times the transfer rate) ................................................................................. 613 figure 15.29 retransfer operation in sci transmit mode.......................................................... 615 figure 15.30 tend flag generation timing in transmission operation................................... 615 figure 15.31 example of transmission processing flow............................................................ 616 figure 15.32 retransfer operation in sci receive mode ........................................................... 617 figure 15.33 example of reception processing flow................................................................. 618 figure 15.34 timing for fixing clock output level................................................................... 618 figure 15.35 clock halt and restart procedure .......................................................................... 619 figure 15.36 example of communication using sci select function ....................................... 620 figure 15.37 summary of sci select function operation .......................................................... 621 figure 15.38 example of clocked synchronous transmission by dmac or dtc.................... 626 figure 15.39 sample flowchart for mode transition during transmission................................ 627 figure 15.40 asynchronous transmission using internal clock ................................................ 628 figure 15.41 synchronous transmission using internal clock .................................................. 628 figure 15.42 sample flowchart for mode transition during reception ..................................... 629 figure 15.43 operation when switching from sck pin function to port pin function ............. 630
rev. 5.00 aug 08, 2006 page lxxiv of l xxxvi figure 15.44 operation when switching from sck pin function to port pin function (example of preventing low-level output).......................................................... 631 section 16 i2c bus interface (iic) (option) figure 16.1 block diagram of i 2 c bus interface....................................................................... 635 figure 16.2 i 2 c bus interface connections (example: this lsi as master) ............................. 636 figure 16.3 i 2 c bus data formats (i 2 c bus formats)............................................................... 654 figure 16.4 i 2 c bus data format (serial format) ..................................................................... 654 figure 16.5 i 2 c bus timing....................................................................................................... 654 figure 16.6 flowchart for iic initialization (example)............................................................. 655 figure 16.7 flowchart for master transmit mode (example)................................................... 656 figure 16.8 example of master transmit mode operation timing (mls = wait = 0) ......... 658 figure 16.9 example of master transmit mode stop condition generation timing (mls = wait = 0) ................................................................................................ 658 figure 16.10 flowchart for master receive mode (receiving multiple bytes) (wait = 1) (example) ...................................................................................................................... 660 figure 16.11 flowchart for master receive mode (receiving 1 byte) (wait = 1) (example) 661 figure 16.12 example of master receive mode operation timing (mls = ackb = 0, wait = 1).............................................................................................................. 663 figure 16.13 example of master receive mode stop condition generation timing (mls = ackb = 0, wait = 1)............................................................................. 664 figure 16.14 flowchart for slave transmit mode (example)..................................................... 665 figure 16.15 example of slave receive mode operation timing (1) (mls = ackb = 0) ....... 667 figure 16.16 example of slave receive mode operation timing (2) (mls = ackb = 0) ....... 668 figure 16.17 sample flowchart for slave transmit mode.......................................................... 669 figure 16.18 example of slave transmit mode operation timing (mls = 0) .......................... 671 figure 16.19 iric setting timing and scl control................................................................... 672 figure 16.20 block diagram of noise canceler.......................................................................... 674 figure 16.21 points for attention concerning reading of master receive data........................ 680 figure 16.22 flowchart and timing of start condition instruction issuance for retransmission ....................................................................................................... 681 figure 16.23 timing of stop condition issuance........................................................................ 682 figure 16.24 iric flag clearance in wait = 1 status .............................................................. 682 figure 16.25 icdr read and iccr access timing in slave transmit mode............................ 683 figure 16.26 trs bit setting timing in slave mode ................................................................. 684 figure 16.27 diagram of erroneous operation wen arbitration is lost .................................... 686 figure 16.28 iric flag clearing timing in wait operation....................................................... 687 section 17 a/d converter figure 17.1 block diagram of a/d converter .......................................................................... 690
rev. 5.00 aug 08, 2006 page lxxv of l xxxvi figure 17.2 access to addr (when reading h'aa40)........................................................... 696 figure 17.3 example of a/d converter operation (single mode, channel 1 selected) ............ 698 figure 17.4 example of a/d converter operation (scan mode, channels an0 to an2 selected) ........................................................................................................ 699 figure 17.5 a/d conversion timing......................................................................................... 700 figure 17.6 external trigger input timing ............................................................................... 701 figure 17.7 a/d conversion accuracy definitions................................................................... 703 figure 17.8 a/d conversion accuracy definitions................................................................... 703 figure 17.9 example of analog input circuit ........................................................................... 704 figure 17.10 example of analog input protection circuit .......................................................... 706 figure 17.11 analog input pin equivalent circuit ...................................................................... 706 section 18 d/a converter figure 18.1 block diagram of d/a converter .......................................................................... 707 figure 18.2 d/a converter operation example ........................................................................ 710 section 20 flash memory (f-ztat version) figure 20.1 block diagram of flash memory........................................................................... 716 figure 20.2 flash memory state transitions............................................................................. 717 figure 20.3 boot mode (example) ............................................................................................ 718 figure 20.4 user program mode (example).............................................................................. 719 figure 20.5 block configuration of 384-kbyte flash memory ................................................. 721 figure 20.6 block configuration of 256-kbyte flash memory ................................................. 722 figure 20.7 block configuration of 128-kbyte flash memory ................................................. 723 figure 20.8 programming/erasing flowchart example in user program mode ....................... 735 figure 20.9 flowchart for flash memory emulation in ram .................................................. 736 figure 20.10 example of ram overlap operation..................................................................... 737 figure 20.11 program/program-verify flowchart....................................................................... 739 figure 20.12 erase/erase-verify flowchart ................................................................................ 741 figure 20.13 socket adapter pin correspondence diagram ....................................................... 744 figure 20.14 power-on/off timing (boot mode) ...................................................................... 748 figure 20.15 power-on/off timing (user program mode) ........................................................ 749 figure 20.16 mode transition timing (example: boot mode user mode ? user program mode) ..................................................................................................................... 750 section 21 masked rom figure 21.1 block diagram of on-chip masked rom (384 kbytes)....................................... 754
rev. 5.00 aug 08, 2006 page lxxvi of l xxxvi section 22 prom figure 22.1 hd6472237 socket adapter pin correspondence diagram (fp-100b, tfp-100b, tfp-100g)........................................................................................... 756 figure 22.2 hd6472237 socket adapter pin correspondence diagram (fp-100a) ................ 757 figure 22.3 memory map in prom mode ............................................................................... 758 figure 22.4 high-speed programming flowchart..................................................................... 760 figure 22.5 prom programming/verification timing............................................................. 763 figure 22.6 recommended screening procedure...................................................................... 764 section 23 clock pulse generator figure 23.1 block diagram of clock pulse generator .............................................................. 765 figure 23.2 connection of crystal resonator (example).......................................................... 770 figure 23.3 crystal resonator equivalent circuit..................................................................... 771 figure 23.4 external clock input (examples) ........................................................................... 772 figure 23.5 external clock input timing.................................................................................. 777 figure 23.6 external clock switching circuit (example)......................................................... 778 figure 23.7 external clock switching timing (example) ........................................................ 778 figure 23.8 connection example of 32.768-khz quartz oscillator.......................................... 780 figure 23.9 equivalence circuit for 32.768-khz oscillator...................................................... 780 figure 23.10 pin handling when subclock not required........................................................... 781 figure 23.11 note on board design of oscillator circuit ........................................................... 782 section 24 power-down modes figure 24.1 mode transition diagram ...................................................................................... 785 figure 24.2 medium-speed mode transition and clearance timing ....................................... 791 figure 24.3 software standby mode application example ...................................................... 794 figure 24.4 hardware standby mode timing ........................................................................... 796 section 25 power supply circuit figure 25.1 power supply connection for h8s/2258 group, h8s/2238b, and h8s/2236b (on-chip internal power supply step-down circuit) ........................................... 804 figure 25.2 power supply connection for h8s/2239 group, h8s/2238r, h8s/2236r, h8s/2237 group, and h8s/2227 group (no internal power supply step-down circuit) ................................................................................................................... 804 section 27 electrical characteristics figure 27.1 power supply voltage and operating ranges (h8s/2258 group)......................... 839 figure 27.2 power supply voltage and operating ranges (h8s/2239 group)......................... 840 figure 27.3 power supply voltage and operating ranges (h8s/2238b and h8s/2236b)....... 841
rev. 5.00 aug 08, 2006 page lxxvii of l xxxvi figure 27.4 power supply voltage and operating ranges (h8s/2238r and h8s/2236r)....... 842 figure 27.5 power supply voltage and operating ranges (h8s/2237 group and h8s/2227 group) ................................................................................................... 843 figure 27.6 output load circuit................................................................................................ 8 53 figure 27.7 i 2 c bus interface input/output timing (optional)................................................. 859 figure 27.8 output load circuit................................................................................................ 8 73 figure 27.9 output load circuit................................................................................................ 8 96 figure 27.10 system clock timing............................................................................................. 948 figure 27.11 oscillation stabilization timing............................................................................. 948 figure 27.12 reset input timing................................................................................................. 949 figure 27.13 interrupt input timing............................................................................................ 9 49 figure 27.14 basic bus timing (two-state access)................................................................... 950 figure 27.15 basic bus timing (three-state access)................................................................. 951 figure 27.16 basic bus timing (three-state access with one wait state) ............................... 952 figure 27.17 burst rom access timing (two-state access).................................................... 953 figure 27.18 burst rom access timing (one-state access) .................................................... 954 figure 27.19 external bus release timing ................................................................................. 954 figure 27.20 dmac single address transfer timing (two-state access) ............................... 955 figure 27.21 dmac single address transfer timing (three-state access) ............................. 956 figure 27.22 dmac tend output timing................................................................................ 957 figure 27.23 dmac dreq input timing .................................................................................. 957 figure 27.24 i/o port input/output timing................................................................................. 957 figure 27.25 tpu input/output timing ...................................................................................... 958 figure 27.26 tpu clock input timing........................................................................................ 958 figure 27.27 8-bit timer output timing .................................................................................... 958 figure 27.28 8-bit timer clock input timing ............................................................................ 959 figure 27.29 8-bit timer reset input timing ............................................................................. 959 figure 27.30 wdt_1 output timing .......................................................................................... 959 figure 27.31 sck clock input timing........................................................................................ 959 figure 27.32 sci input/output timing (clocked synchronous mode)....................................... 960 figure 27.33 a/d converter external trigger input timing....................................................... 960 figure 27.34 i 2 c bus interface input/output timing (optional)................................................. 960 appendix c package dimensions figure c.1 tfp-100b package dimensions............................................................................. 973 figure c.2 tfp-100g package dimensions............................................................................. 974 figure c.3 fp-100a package dimensions ............................................................................... 975 figure c.4 fp-100b package dimensions ............................................................................... 976 figure c.5 bp-112 package dimensions ................................................................................. 977 figure c.6 tbp-112a, tbp-112av package dimensions...................................................... 978
rev. 5.00 aug 08, 2006 page lxxviii of l xxxvi tables section 1 overview table 1.1 pin arrangements in each mode of h8s/2258 group ........................................... 20 table 1.2 pin arrangements in each mode of h8s/2239 group ........................................... 24 table 1.3 pin arrangements in each mode of h8s/2238 group ........................................... 29 table 1.4 pin arrangements in each mode of h8s/2237 group ........................................... 34 table 1.5 pin arrangements in each mode of h8s/2227 group ........................................... 39 table 1.6 pin functions of h8s/2258 group ......................................................................... 44 table 1.7 pin functions of h8s/2239 group and h8s/2238 group ...................................... 50 table 1.8 pin functions of h8s/2237 group and h8s/2227 group ...................................... 57 section 2 cpu table 2.1 instruction classification........................................................................................ 79 table 2.2 operation notation................................................................................................. 80 table 2.3 data transfer instructions ...................................................................................... 81 table 2.4 arithmetic operations instructions ........................................................................ 82 table 2.5 logic operations instructions ................................................................................ 84 table 2.6 shift instructions .................................................................................................... 84 table 2.7 bit manipulation instructions................................................................................. 85 table 2.8 branch instructions ................................................................................................ 87 table 2.9 system control instructions ................................................................................... 88 table 2.10 block data transfer instructions............................................................................ 89 table 2.11 addressing modes.................................................................................................. 90 table 2.12 absolute address access ranges .......................................................................... 92 table 2.13 effective address calculation................................................................................ 94 section 3 mcu operating modes table 3.1 mcu operating mode selection............................................................................ 103 table 3.2 pin functions in each operating mode.................................................................. 108 section 4 exception handling table 4.1 exception types and priority ................................................................................. 119 table 4.2 exception handling vector table.......................................................................... 120 table 4.3 reset types ........................................................................................................... . 121 table 4.4 status of ccr and exr after trace exception handling...................................... 124 table 4.5 status of ccr and exr after trap instruction exception handling ..................... 125
rev. 5.00 aug 08, 2006 page lxxix of lxxxvi section 5 interrupt controller table 5.1 pin configuration ................................................................................................... 12 9 table 5.2 interrupt sources, vector addresses, and interrupt priorities ................................ 137 table 5.3 interrupt control modes ......................................................................................... 142 table 5.4 interrupts selected in each interrupt control mode (1) ......................................... 143 table 5.5 interrupts selected in each interrupt control mode (2) ......................................... 144 table 5.6 operations and control signal functions in each interrupt control mode ........... 144 table 5.7 interrupt response times....................................................................................... 150 table 5.8 number of states in interrupt handling routine execution status ........................ 151 table 5.9 interrupt source selection and clear control......................................................... 153 section 7 bus controller table 7.1 pin configuration ................................................................................................... 16 7 table 7.2 bus specifications for each area (basic bus interface) ........................................ 177 table 7.3 data buses used and valid strobes ....................................................................... 182 table 7.4 pin states in idle cycle........................................................................................... 196 table 7.5 pin states in bus released state............................................................................. 197 section 8 dma controller (dmac) table 8.1 pin configuration ................................................................................................... 20 5 table 8.2 short address mode and full address mode (channel 0)..................................... 206 table 8.3 dmac activation sources..................................................................................... 232 table 8.4 dmac transfer modes.......................................................................................... 234 table 8.5 register functions in sequential mode.................................................................. 236 table 8.6 register functions in idle mode ............................................................................ 239 table 8.7 register functions in repeat mode........................................................................ 241 table 8.8 register functions in single address mode .......................................................... 245 table 8.9 register functions in normal mode ...................................................................... 248 table 8.10 register functions in block transfer mode........................................................... 251 table 8.11 dmac channel priority order .............................................................................. 271 table 8.12 interrupt sources and priority order ...................................................................... 275 section 9 data transfer controller (dtc) table 9.1 activation source and dtcer clearance ............................................................. 289 table 9.2 interrupt sources, dtc vector addresses, and corresponding dtces ................ 292 table 9.3 register information in normal mode ................................................................... 295 table 9.4 register information in repeat mode .................................................................... 296 table 9.5 register information in block transfer mode ....................................................... 297 table 9.6 dtc execution status ............................................................................................ 301
rev. 5.00 aug 08, 2006 page l xxx of l xxxvi table 9.7 number of states required for each execution status .......................................... 301 section 10 i/o ports table 10.1 port functions ....................................................................................................... . 306 table 10.2 input pull-up mos states in port a ...................................................................... 332 table 10.3 input pull-up mos states in port b ...................................................................... 339 table 10.4 input pull-up mos states in port c ...................................................................... 342 table 10.5 input pull-up mos states in port d ...................................................................... 346 table 10.6 input pull-up mos states in port e ...................................................................... 349 section 11 16-bit timer pulse unit (tpu) table 11.1 tpu functions........................................................................................................ 360 table 11.2 pin configuration ................................................................................................... 3 64 table 11.3 cclr2 to cclr0 (channels 0 and 3)................................................................... 368 table 11.4 cclr2 to cclr0 (channels 1, 2, 4, and 5).......................................................... 368 table 11.5 tpsc2 to tpsc0 (channel 0)................................................................................ 369 table 11.6 tpsc2 to tpsc0 (channel 1)................................................................................ 369 table 11.7 tpsc2 to tpsc0 (channel 2)................................................................................ 370 table 11.8 tpsc2 to tpsc0 (channel 3)................................................................................ 370 table 11.9 tpsc2 to tpsc0 (channel 4)................................................................................ 371 table 11.10 tpsc2 to tpsc0 (channel 5)................................................................................ 371 table 11.11 md3 to md0.......................................................................................................... 373 table 11.12 tiorh_0 ............................................................................................................. . 375 table 11.13 tiorl_0 ............................................................................................................. . 376 table 11.14 tior_1 .............................................................................................................. 377 table 11.15 tior_2 .............................................................................................................. 378 table 11.16 tiorh_3 ............................................................................................................. . 379 table 11.17 tiorl_3 ............................................................................................................. . 380 table 11.18 tior_4 .............................................................................................................. 381 table 11.19 tior_5 .............................................................................................................. 382 table 11.20 tiorh_0 ............................................................................................................. . 383 table 11.21 tiorl_0 ............................................................................................................. . 384 table 11.22 tior_1 .............................................................................................................. 385 table 11.23 tior_2 .............................................................................................................. 386 table 11.24 tiorh_3 ............................................................................................................. . 387 table 11.25 tiorl_3 ............................................................................................................. . 388 table 11.26 tior_4 .............................................................................................................. 389 table 11.27 tior_5 .............................................................................................................. 390 table 11.28 register combinations in buffer operation........................................................... 405 table 11.29 cascaded combinations ......................................................................................... 409
rev. 5.00 aug 08, 2006 page lxxxi of l xxxvi table 11.30 pwm output registers and output pins ................................................................ 412 table 11.31 clock input pins in phase counting mode............................................................. 416 table 11.32 up/down-count conditions in phase counting mode 1 ....................................... 418 table 11.33 up/down-count conditions in phase counting mode 2 ....................................... 419 table 11.34 up/down-count conditions in phase counting mode 3 ....................................... 420 table 11.35 up/down-count conditions in phase counting mode 4 ....................................... 421 table 11.36 tpu interrupts...................................................................................................... .. 424 section 12 8-bit timers table 12.1 pin configuration ................................................................................................... 4 43 table 12.2 8-bit timer interrupt sources ................................................................................ 458 table 12.3 timer output priorities .......................................................................................... 461 table 12.4 switching of internal clock and tcnt operation................................................. 462 section 13 watchdog timer (wdt) table 13.1 pin configuration ................................................................................................... 4 67 table 13.2 wdt interrupt source............................................................................................ 476 section 14 iebus ? ? ? ? controller (ieb) [h8s/2258 group] table 14.1 mode types........................................................................................................... . 483 table 14.2 transfer speed and maximum number of transfer bytes in each communications mode .......................................................................................... 484 table 14.3 contents of message length bits........................................................................... 489 table 14.4 control bit contents............................................................................................... 49 3 table 14.5 control field for locked slave unit ...................................................................... 494 table 14.6 pin configuration ................................................................................................... 4 97 section 15 serial communication interface (sci) table 15.1 pin configuration ................................................................................................... 5 51 table 15.2 the relationships between the n setting in brr and bit rate b ......................... 571 table 15.3 brr settings for various bit rates (asynchronous mode) .................................. 572 table 15.4 maximum bit rate for each frequency (asynchronous mode) ............................ 576 table 15.5 maximum bit rate with external clock input (asynchronous mode) .................. 577 table 15.6 brr settings for various bit rates (clocked synchronous mode) ...................... 578 table 15.7 maximum bit rate with external clock input (clocked synchronous mode)...... 579 table 15.8 examples of bit rate for various brr settings (smart card interface mode) (when n = 0 and s = 372) ...................................................................................... 580 table 15.9 maximum bit rate at various frequencies (smart card interface mode) (when s = 372) ...................................................................................................... 580 table 15.10 serial transfer formats (asynchronous mode) ..................................................... 586
rev. 5.00 aug 08, 2006 page l xxxii of lxxxvi table 15.11 ssr status flags and receive data handling........................................................ 593 table 15.12 interrupt sources of serial communication interface mode.................................. 623 table 15.13 interrupt sources in smart card interface mode.................................................... 624 section 16 i2c bus interface (iic) (option) table 16.1 pin configuration ................................................................................................... 6 36 table 16.2 transfer format...................................................................................................... 640 table 16.3 i 2 c transfer rate.................................................................................................... 642 table 16.4 flags and transfer states ....................................................................................... 648 table 16.5 flags and transfer states ....................................................................................... 673 table 16.6 iic interrupt source ............................................................................................... 67 6 table 16.7 i 2 c bus timing (scl and sda output) ................................................................ 677 table 16.8 permissible scl rise time (t sr ) values................................................................. 678 table 16.9 i 2 c bus timing (with maximum influence of t sr /t sf ) ............................................. 679 section 17 a/d converter table 17.1 pin configuration ................................................................................................... 6 91 table 17.2 analog input channels and corresponding addr registers................................ 692 table 17.3 a/d conversion time (single mode) .................................................................... 700 table 17.4 a/d conversion time (scan mode)....................................................................... 700 table 17.5 a/d converter interrupt source ............................................................................. 701 table 17.6 analog pin specifications ...................................................................................... 706 section 18 d/a converter table 18.1 pin configuration ................................................................................................... 7 08 table 18.2 d/a conversion control ........................................................................................ 709 section 20 flash memory (f-ztat version) table 20.1 differences between boot mode and user program mode.................................... 717 table 20.2 pin configuration ................................................................................................... 7 24 table 20.3 setting on-board programming modes ................................................................. 732 table 20.4 boot mode operation............................................................................................. 734 table 20.5 system clock frequencies for which automatic adjustment of lsi bit rate is possible............................................................................................................... 734 table 20.6 flash memory operating states ............................................................................. 745 table 20.7 registers present in f-ztat version but absent in masked rom version ........ 751 section 22 prom table 22.1 selecting prom mode .......................................................................................... 755 table 22.2 socket adapters...................................................................................................... 758
rev. 5.00 aug 08, 2006 page l xxxiii of l xxxvi table 22.3 mode selection in prom mode ............................................................................ 759 table 22.4 dc characteristics in prom mode ....................................................................... 761 table 22.5 ac characteristics in prom mode ....................................................................... 762 section 23 clock pulse generator table 23.1 damping resistance value..................................................................................... 771 table 23.2 crystal resonator characteristics........................................................................... 771 table 23.3 external clock input conditions (1) (h8s/2258 group) ....................................... 772 table 23.3 external clock input conditions (2) (h8s/2238b, h8s/2236b) ........................... 773 table 23.3 external clock input conditions (3) (h8s/2238r, h8s/2236r) ........................... 773 table 23.3 external clock input conditions (4) (h8s/2237 group, h8s/2227 group) .......... 774 table 23.3 external clock input conditions (5) (h8s/2239 group) ....................................... 774 table 23.4 external clock input conditions (duty adjustment circuit unused) (1) (h8s/2258 group).................................................................................................. 775 table 23.4 external clock input conditions (duty adjustment circuit unused) (2) (h8s/2238b, h8s/2236b)............................................................................................. 775 table 23.4 external clock input conditions (duty adjustment circuit unused) (3) (h8s/2238r, h8s/2236r)............................................................................................. 776 table 23.4 external clock input conditions (duty adjustment circuit unused) (4) (h8s/2237 group, h8s/2227 group)............................................................................ 776 table 23.4 external clock input conditions (duty adjustment circuit unused) (5) (h8s/2239 group) ......................................................................................................... 777 section 24 power-down modes table 24.1 lsi internal states in each mode........................................................................... 784 table 24.2 low power dissipation mode transition conditions ............................................ 786 table 24.3 oscillation settling time settings.......................................................................... 793 table 24.4 pin states in respective processes ...................................................................... 800 section 27 electrical characteristics table 27.1 absolute maximum ratings................................................................................... 844 table 27.2 dc characteristics (1) ............................................................................................ 845 table 27.2 dc characteristics (2) ............................................................................................ 847 table 27.2 dc characteristics (3) ............................................................................................ 849 table 27.3 permissible output current .................................................................................... 851 table 27.4 bus driving characteristics.................................................................................... 852 table 27.5 clock timing......................................................................................................... . 854 table 27.6 control signal timing............................................................................................ 855 table 27.7 bus timing........................................................................................................... .. 856 table 27.8 timing of on-chip peripheral modules................................................................. 857
rev. 5.00 aug 08, 2006 page l xxxiv of l xxxvi table 27.9 i 2 c bus timing....................................................................................................... 858 table 27.10 a/d conversion characteristics ............................................................................. 860 table 27.11 d/a conversion characteristics ............................................................................. 861 table 27.12 flash memory characteristics................................................................................ 862 table 27.13 absolute maximum ratings................................................................................... 864 table 27.14 dc characteristics (1)............................................................................................ 86 5 table 27.14 dc characteristics (2)............................................................................................ 86 7 table 27.14 dc characteristics (3)............................................................................................ 86 9 table 27.15 permissible output currents .................................................................................. 871 table 27.16 bus driving characteristics.................................................................................... 872 table 27.17 clock timing........................................................................................................ .. 874 table 27.18 control signal timing............................................................................................ 876 table 27.19 bus timing.......................................................................................................... ... 877 table 27.20 dmac timing ....................................................................................................... 87 9 table 27.21 timing of on-chip peripheral modules................................................................. 880 table 27.22 i 2 c bus timing....................................................................................................... 882 table 27.23 a/d conversion characteristics ............................................................................. 883 table 27.24 d/a conversion characteristics ............................................................................. 884 table 27.25 flash memory characteristics................................................................................ 885 table 27.26 absolute maximum ratings................................................................................... 887 table 27.27 dc characteristics (1)............................................................................................ 88 8 table 27.27 dc characteristics (2)............................................................................................ 89 0 table 27.27 dc characteristics (3)............................................................................................ 89 2 table 27.28 permissible output currents .................................................................................. 894 table 27.29 bus drive characteristics....................................................................................... 895 table 27.30 clock timing........................................................................................................ .. 897 table 27.31 control signal timing............................................................................................ 898 table 27.32 bus timing.......................................................................................................... ... 899 table 27.33 timing of on-chip peripheral modules................................................................. 901 table 27.34 i 2 c bus timing....................................................................................................... 903 table 27.35 a/d conversion characteristics (f-ztat and masked rom versions) .............. 904 table 27.36 d/a conversion characteristics (f-ztat and masked rom versions) .............. 904 table 27.37 flash memory characteristics................................................................................ 905 table 27.38 absolute maximum ratings................................................................................... 907 table 27.39 dc characteristics (1)............................................................................................ 90 8 table 27.39 dc characteristics (2)............................................................................................ 91 0 table 27.39 dc characteristics (3)............................................................................................ 91 2 table 27.40 permissible output currents .................................................................................. 914 table 27.41 bus driving characteristics.................................................................................... 915 table 27.42 clock timing........................................................................................................ .. 916
rev. 5.00 aug 08, 2006 page lxxxv of l xxxvi table 27.43 control signal timing............................................................................................ 917 table 27.44 bus timing.......................................................................................................... ... 918 table 27.45 timing of on-chip peripheral modules................................................................. 920 table 27.46 i 2 c bus timing....................................................................................................... 922 table 27.47 a/d conversion characteristics ............................................................................. 923 table 27.48 d/a conversion characteristics ............................................................................. 924 table 27.49 flash memory characteristics ................................................................................ 925 table 27.50 absolute maximum ratings................................................................................... 927 table 27.51 dc characteristics (1) ............................................................................................ 92 8 table 27.51 dc characteristics (2) ............................................................................................ 93 0 table 27.51 dc characteristics (3) ............................................................................................ 93 2 table 27.51 dc characteristics (4) ............................................................................................ 93 4 table 27.52 permissible output currents................................................................................... 936 table 27.53 clock timing........................................................................................................ .. 937 table 27.54 control signal timing............................................................................................ 939 table 27.55 bus timing.......................................................................................................... ... 940 table 27.56 timing of on-chip peripheral modules................................................................. 942 table 27.57 a/d conversion characteristics ............................................................................. 944 table 27.58 d/a conversion characteristics ............................................................................. 945 table 27.59 flash memory characteristics ................................................................................ 946 appendix b product codes table b.1 product codes of h8s/2258 group........................................................................ 968 table b.2 product codes of h8s/2239 group........................................................................ 969 table b.3 product codes of h8s/2238 group........................................................................ 970 table b.4 product codes of h8s/2237 group and h8s/2227 group ..................................... 972
rev. 5.00 aug 08, 2006 page l xxxvi of l xxxvi
section 1 overview rev. 5.00 aug 08, 2006 page 1 of 982 rej09b0054-0500 section 1 overview 1.1 features ? high-speed h8s/2000 central processing unit with an internal 16-bit architecture ? upward-compatible with h8/300 and h8/300h cpus on an object level ? sixteen 16-bit general registers ? 65 basic instructions ? various peripheral functions ? pc break controller ? dma controller (dmac) supported only by the h8s/2239 group. ? data transfer controller (dtc) ? 16-bit timer-pulse unit (tpu) h8s/2258 group, h8s/2239 group, h8s/2238 group, and h8s/2237 group: six channels h8s/2227 group: three channels ? 8-bit timer (tmr) h8s/2258 group, h8s/2239 group, h8s/2238 group: four channels h8s/2237 group, h8s/2227 group: two channels ? watchdog timer (wdt) ? serial communication interface (sci) h8s/2258 group, h8s/2239 group, h8s/2238 group, and h8s/2237 group: four channels (sci_0 to sci_3) h8s/2227 group: three channels (sci_0, sci_1, and sci_3) ? i 2 c bus interface (iic) optional function for the h8s/2258 group, h8s/2239 group, and h8s/2238 group ? 10-bit a/d converter ? 8-bit d/a converter not available in the h8s/2227 group. ? iebus controller (ieb) h8s/2258 group: one channel
section 1 overview rev. 5.00 aug 08, 2006 page 2 of 982 rej09b0054-0500 ? on-chip memory rom model rom ram remarks hd64f2258 256 kbytes 16 kbytes hd64f2239 384 kbytes 32 kbytes hd64f2238b 256 kbytes 16 kbytes hd64f2238r 256 kbytes 16 kbytes flash memory version hd64f2227 128 kbytes 16 kbytes prom version hd6472237 128 kbytes 16 kbytes hd6432258 256 kbytes 16 kbytes masked rom version hd6432258w 256 kbytes 16 kbytes HD6432256 128 kbytes 8 kbytes HD6432256w 128 kbytes 8 kbytes hd6432239 384 kbytes 32 kbytes hd6432239w 384 kbytes 32 kbytes hd6432238b 256 kbytes 16 kbytes hd6432238bw 256 kbytes 16 kbytes hd6432238r 256 kbytes 16 kbytes hd6432238rw 256 kbytes 16 kbytes hd6432236b 128 kbytes 8 kbytes hd6432236bw 128 kbytes 8 kbytes hd6432236r 128 kbytes 8 kbytes hd6432236rw 128 kbytes 8 kbytes hd6432237 128 kbytes 16 kbytes hd6432235 128 kbytes 4 kbytes hd6432233 64 kbytes 4 kbytes hd6432227 128 kbytes 16 kbytes hd6432225 128 kbytes 4 kbytes hd6432224 96 kbytes 4 kbytes hd6432223 64 kbytes 4 kbytes ? general i/o ports ? i/o pins: 72 ? input-only pins: 10 ? supports various power-down states
section 1 overview rev. 5.00 aug 08, 2006 page 3 of 982 rej09b0054-0500 ? compact package package (code) * 6 body size pin pitch tqfp-100 tfp-100b, tfp-100bv 14.0 14.0 mm 0.5 mm tqfp-100 * 1 tfp-100g, tfp-100gv 12.0 12.0 mm 0.4 mm qfp-100 * 2 fp-100a, fp-100av 14.0 20.0 mm 0.65 mm qfp-100 * 3 fp-100b, fp-100bv 14.0 14.0 mm 0.5 mm lfbga-112 * 4 bp-112, bp-112v 10.0 10.0 mm 0.8 mm tfbga-112 * 5 tbp-112a, tbp-112av 10.0 10.0 mm 0.8 mm notes: 1. not supported by the h8s/2258 group. 2. supported only by the h8s/2258 group, h8s/2238b, h8s/2236b, h8s/2237 group, and hd6432227. 3. not supported by the hd64f2227. 4. supported only by the hd64f2238r. 5. supported only by thehd64f2238r and hd64f2239. 6. package code ending in the letter v designate pb-free product.
section 1 overview rev. 5.00 aug 08, 2006 page 4 of 982 rej09b0054-0500 1.2 internal block diagram figures 1.1 to 1.5 show the internal block diagrams. pe7/d7 pe6/d6 pe5 /d5 pe4 /d4 pe3 /d3 pe2 /d2 pe1 /d1 pe0 /d0 internal data bus pd7/d15 pd6/d14 pd5/d13 pd4/d12 pd3/d11 pd2/d10 pd1/d9 pd0/d8 port d cv cc v cc v ss v ss pa3 / a19/sck2 pa2 / a18/rxd2 pa1 / a17/txd2 pa0 / a16 pb7 / a15/tiocb5 pb6 / a14/tioca5 pb5 / a13/tiocb4 pb4 / a12/tioca4 pb3 / a11/tiocd3 pb2/a10/tiocc3 pb1 / a9/tiocb3 pb0 / a8/tioca3 pc7/a7 pc6/a6 pc5/a5 pc4/a4 pc3/a3 pc2/a2 pc1/a1 pc0/a0 p36 p35 /sck1/scl0/ irq5 p34 /rxd1/sda0 p33 /txd1/scl1 p32 /sck0/sda1/ irq 4 p31 /rxd0 p30 /txd0 p97 /da1 p96 /da0 p47 /an7 p46 /an6 p45 /an5 p44 /an4 p43 /an3 p42 /an2 p41 /an1 p40 /an0 vref avcc avss p10 / tioca0 /a20 p11 / tiocb0 /a21 p12 / tiocc0 / tclka/a22 p13 / tiocd0 / tclkb/a23 p14 /tioca1/ irq0 p15 / tiocb1 / tclkc p16 /tioca2/ irq1 p17 / tiocb2/ tclkd p70/tmri01/tmci01/ cs4 p71/tmri23/tmci23/ cs5 p72 /tmo0/ cs6 p73 /tmo1/ cs7 p74/tmo2/ mres p75/tmo3/ sck3 p76 /rxd3 p77 /txd3 pg4 / cs0 pg3 / cs1 pg2 / cs2 pg1 / cs3 / irq7 pg0 / irq6 pf7 / pf6 / as pf5 / rd pf4 / hwr pf3 / lwr / adtrg / irq3 pf2 / wait pf1 / back /buzz pf0 / breq / irq2 pc break controller (2 channels) rom ram tpu (6 channels) ieb (1 channel) md2 md1 md0 extal xtal osc1 osc2 stby res nmi fwe h8s/2000 cpu dtc interrupt controller port e port 4 port 1 port 7 internal address bus port a port b bus controller port c port 3 port 9 port g port f sci (4 channels) d/a converter (2 channels) 8-bit timer (4 channels) a/d converter (8 channels) wdt0 wdt1 (subclock) subclock pulse generator system clock pulse generator iic bus interface (option) peripheral data bus peripheral address bus figure 1.1 internal block diagram of h8s/2258 group
section 1 overview rev. 5.00 aug 08, 2006 page 5 of 982 rej09b0054-0500 pe7/d7 pe6/d6 pe5/d5 pe4/d4 pe3/d3 pe2/d2 pe1/d1 pe0/d0 internal data bus pd7 / d15 pd6 / d14 pd5 / d13 pd4 / d12 pd3 / d11 pd2 / d10 pd1/d9 pd0/d8 port d cv cc v cc v ss v ss pa3 / a19/sck2 pa2 / a18/rxd2 pa1 / a17/txd2 pa0 / a16 pb7 / a15/tiocb5 pb6 / a14/tioca5 pb5 / a13/tiocb4 pb4 / a12/tioca4 pb3 / a11/tiocd3 pb2/a10/tiocc3 pb1 / a9/tiocb3 pb0 / a8/tioca3 pc7/a7 pc6/a6 pc5/a5 pc4/a4 pc3/a3 pc2/a2 pc1/a1 pc0/a0 p36 p35 /sck1/scl0/ irq5 p34/rxd1/sda0 p33 /txd1/scl1 p32/sck0/sda1/ irq 4 p31/rxd0 p30 /txd0 p97 /da1 p96 /da0 p47 / an7 p46 / an6 p45 / an5 p44 / an4 p43 / an3 p42 / an2 p41 / an1 p40 / an0 vref avcc avss p10 / tioca0 / dack0 /a20 p11 / tiocb0 / dack1 /a21 p12 / tiocc0 / tclka/a22 p13 / tiocd0 / tclkb/a23 p14 / tioca1/ irq0 p15 / tiocb1 / tclkc p16 / tioca2/ irq1 p17 / tiocb2/ tclkd p70/tmri01/tmci01/ dreq0 / cs4 p71/tmri23/tmci23/ dreq1 / cs5 p72 / tmo0/ tend0 / cs6 p73 / tmo1/ tend1 / cs7 p74/tmo2/ mres p75/tmo3/ sck3 p76 / rxd3 p77 / txd3 pg4 / cs0 pg3 / cs1 pg2 / cs2 pg1 / cs3 / irq7 pg0 / irq6 pf7 / pf6 / as pf5 / rd pf4 / hwr pf3 / lwr / adtrg / irq3 pf2 / wait pf1 / back /buzz pf0 / breq / irq2 pc break controller (2 channels) rom ram tpu (6 channels) md2 md1 md0 extal xtal osc1 osc2 stby res nmi fwe h8s/2000 cpu dmac dtc interrupt controller port e port 4 port 1 port 7 internal address bus port a port b bus controller port c port 3 port 9 port g port f sci (4 channels) d/a converter (2 channels) 8-bit timer (4 channels) a/d converter (8 channels) wdt0 wdt1 (subclock) subclock pulse generator system clock pulse generator iic bus interface (option) peripheral data bus peripheral address bus figure 1.2 internal block diagram of h8s/2239 group
section 1 overview rev. 5.00 aug 08, 2006 page 6 of 982 rej09b0054-0500 pe7/d7 pe6/d6 pe5 /d5 pe4 /d4 pe3 /d3 pe2 /d2 pe1 /d1 pe0 /d0 pd7/d15 pd6/d14 pd5/d13 pd4/d12 pd3/d11 pd2/d10 pd1/d9 pd0/d8 cv cc v cc v ss v ss pa3 / a19/sck2 pa2 / a18/rxd2 pa1 / a17/txd2 pa0 / a16 pb7 / a15/tiocb5 pb6 / a14/tioca5 pb5 / a13/tiocb4 pb4 / a12/tioca4 pb3 / a11/tiocd3 pb2/a10/tiocc3 pb1 / a9/tiocb3 pb0 / a8/tioca3 pc7/a7 pc6/a6 pc5/a5 pc4/a4 pc3/a3 pc2/a2 pc1/a1 pc0/a0 p36 p35 /sck1/scl0/ irq5 p34 /rxd1/sda0 p33 /txd1/scl1 p32 /sck0/sda1/ irq 4 p31 /rxd0 p30 /txd0 p97 /da1 p96 /da0 p47 /an7 p46 /an6 p45 /an5 p44 /an4 p43 /an3 p42 /an2 p41 /an1 p40 /an0 vref avcc avss p10 / tioca0 /a20 p11 / tiocb0 /a21 p12 /tiocc0 /tclka/a22 p13 /tiocd0 /tclkb/a23 p14 /tioca1/i rq0 p15 / tiocb1 / tclkc p16 /tioca2/ irq1 p17 / tiocb2/ tclkd p70/tmri01/tmci01/ cs4 p71/tmri23/tmci23/ cs5 p72/tmo0/ cs6 p73/tmo1/ cs7 p74/tmo2/ mres p75/tmo3/sck3 p76/rxd3 p77/txd3 pg4 / cs0 pg3 / cs1 pg2 / cs2 pg1 / cs3 / irq7 pg0 / irq6 pf7 / pf6 / as pf5 / rd pf4 / hwr pf3 / lwr / adtrg / irq3 pf2 / wait pf1 / back /buzz pf0 / breq / irq2 md2 md1 md0 extal xtal osc1 osc2 stby res nmi fwe h8s/2000 cpu dtc internal data bus port d pc break controller (2 channels) rom ram tpu (6 channels) interrupt controller port e port 4 port 1 port 7 internal address bus port a port b bus controller port c port 3 port 9 port g port f sci (4 channels) d/a converter (2 channels) 8-bit timer (4 channels) a/d converter (8 channels) wdt0 wdt1 (subclock) subclock pulse generator system clock pulse generator iic bus interface (option) peripheral data bus peripheral address bus figure 1.3 internal block diagram of h8s/2238 group
section 1 overview rev. 5.00 aug 08, 2006 page 7 of 982 rej09b0054-0500 pe7/d7 pe6/d6 pe5 / d5 pe4 / d4 pe3 / d3 pe2 / d2 pe1 / d1 pe0 / d0 pd7 / d15 pd6 / d14 pd5 / d13 pd4 / d12 pd3 / d11 pd2 / d10 pd1/d9 pd0/d8 v cc v cc v ss v ss pa3 / a19/sck2 pa2 / a18/rxd2 pa1 / a17/txd2 pa0 / a16 pb7 / a15/tiocb5 pb6 / a14/tioca5 pb5 / a13/tiocb4 pb4 / a12/tioca4 pb3 / a11/tiocd3 pb2/a10/tiocc3 pb1 / a9/tiocb3 pb0 / a8/tioca3 pc7 / a7 pc6 / a6 pc5 / a5 pc4 / a4 pc3 / a3 pc2 / a2 pc1 / a1 pc0 / a0 p36 p35 / sck1/ irq5 p34 / rxd1 p33 / txd1 p32 / sck0/ irq4 p31 / rxd0 p30 / txd0 p97 / da1 p96 /da0 p47 /an7 p46 /an6 p45 /an5 p44 /an4 p43 /an3 p42 /an2 p41 /an1 p40 /an0 vref avcc avss p10 / tioca0 /a20 p11 / tiocb0 /a21 p12 / tiocc0 / tclka/a22 p13 / tiocd0 / tclkb/a23 p14 /tioca1/ irq0 p15 / tiocb1 / tclkc p16 /tioca2/ irq1 p17 / tiocb2/ tclkd p70/tmri01/ tmci01/ cs4 p71 / cs5 p72 / tmo0/ cs6 p73 / tmo1/ cs7 p74 / mres p75 /sck3 p76 /rxd3 p77 /txd3 pg4/ cs0 pg3/ cs1 pg2/ cs2 pg1/ cs3 / irq7 pg0/ irq6 pf7/ pf6/ as pf5/ rd pf4/ hwr pf3/ lwr / adtrg / irq3 pf2/ wait pf1/ back / buzz pf0/ breq / irq2 md2 md1 md0 extal xtal osc1 osc2 stby res nmi fwe h8s/2000 cpu internal data bus port d pc break controller (2 channels) rom ram tpu (6 channels) dtc interrupt controller port e port 4 port 1 port 7 internal address bus port a port b bus controller port c port 3 port 9 port g port f sci (4 channels) d/a converter (2 channels) 8-bit timer (2 channels) a/d converter (8 channels) wdt0 wdt1 (subclock) subclock pulse generator system clock pulse generator peripheral data bus peripheral address bus figure 1.4 internal block diagram of h8s/2237 group
section 1 overview rev. 5.00 aug 08, 2006 page 8 of 982 rej09b0054-0500 pe7/d7 pe6/d6 pe5 /d5 pe4 /d4 pe3 /d3 pe2 /d2 pe1 /d1 pe0 /d0 pd7/d15 pd6/d14 pd5/d13 pd4/d12 pd3/d11 pd2/d10 pd1/d9 pd0/d8 v cc v cc v ss v ss pa3 / a19 pa2 / a18 pa1 / a17 pa0 / a16 pb7 / a15 pb6 / a14 pb5 / a13 pb4 / a12 pb3 / a11 pb2/a10 pb1/a9 pb0/a8 pc7 / a7 pc6 / a6 pc5 / a5 pc4 / a4 pc3 / a3 pc2 / a2 pc1 / a1 pc0 / a0 p36 p35 / sck1/ irq 5 p34 / rxd1 p33 / txd1 p32 / sck0/ irq 4 p31 / rxd0 p30 / txd0 p97 p96 p47 / an7 p46 / an6 p45 / an5 p44 / an4 p43 / an3 p42 / an2 p41 / an1 p40 / an0 vref avcc avss p10 /tioca0 /a20 p11 /tiocb0 /a21 p12 /tiocc0 /tclka/a22 p13 /tiocd0 /tclkb/a23 p14 /tioca1/ irq0 p15 /tiocb1 / tclkc p16 /tioca2/ irq1 p17 /tiocb2/ tclkd p70/tmri01/ tmci01/ cs4 p71 / cs5 p72 /tmo0/ cs6 p73 /tmo1/ cs7 p74 / mres p75 /sck3 p76 /rxd3 p77 /txd3 pg4 / cs0 pg3 / cs1 pg2 / cs2 pg1 / cs3 / irq7 pg0 / irq6 pf7 / pf6 / as pf5 / rd pf4 / hwr pf3 / lwr / adtrg / irq3 pf2 / wait pf1 / back / buzz pf0 / breq / irq2 md2 md1 md0 extal xtal osc1 osc2 stby res nmi fwe h8s/2000 cpu internal data bus port d pc break controller (2 channels) rom ram tpu (3 channels) dtc interrupt controller port e port 4 port 1 port 7 internal address bus port a port b bus controller port c port 3 port 9 port g port f sci (3 channels) 8-bit timer (2 channels) a/d converter (8 channels) wdt0 wdt1 (subclock) subclock pulse generator system clock pulse generator peripheral data bus peripheral address bus figure 1.5 internal block diagram of h8s/2227 group
section 1 overview rev. 5.00 aug 08, 2006 page 9 of 982 rej09b0054-0500 1.3 pin description 1.3.1 pin arrangement (1) pin arrangement of h8s/2258 group figures 1.6 and 1.7 show the pin arrangement of the h8s/2258 group. p30/txd0 p31/rxd0 p32/sck0/sda1/ irq4 p33/txd1/scl1 p34/rxd1/sda0 p35/sck1/scl0/ irq5 p36 p77/txd3 p76/rxd3 p75/tmo3/sck3 p74/tmo2/ mres p73/tmo1/ cs7 p72/tmo0/ cs6 p71/tmri23/tmci23/ cs5 p70/tmri01/tmci01/ cs4 pg0/ irq6 pg1/ cs3 / irq7 pg2/ tx / cs2 pg3/ rx / cs1 pg4/ cs0 pe0/d0 pe1/d1 pe2/d2 pe3/d3 pe4/d4 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 pf0/ breq / irq2 pf1/ back /buzz pf2/ wait pf3/ lwr / adtrg / irq 3 pf4/ hwr pf5/ rd pf6/ as pf7/ md2 fwe extal vss xtal vcc stby nmi res osc1 osc2 md1 md0 avcc vref p40/an0 p41/an1 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 p42/an2 p43/an3 p44/an4 p45/an5 p46/an6 p47/an7 p96/da0 p97/da1 p17/tiocb2/tclkd p16/tioca2/ irq1 p14/tioca1/ irq0 p13/tiocd0/tclkb/a23 p12/tiocc0/tclka/a22 p11/tiocb0/a21 p10/tioca0/a20 pa3/a19/sck2 pa2/a18/rxd2 pa1/a17/txd2 pa0/a16 pb7/a15/tiocb5 pb6/a14/tioca5 pb5/a13/tiocb4 pb4/a12/tioca4 avss p15/tiocb1/tclkc 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 pe5/d5 pe6/d6 pe7/d7 pd0/d8 pd1/d9 pd2/d10 pd3/d11 pd4/d12 pd5/d13 pd6/d14 pd7/d15 pc1/a1 pc2/a2 pc3/a3 pc4/a4 pc5/a5 pc6/a6 pc7/a7 pb0/a8/tioca3 pb2/a10/tiocc3 pb3/a11/tiocd3 cvcc pc0/a0 vss pb1/a9/tiocb3 tfp-100b tfp-100bv fp-100b fp-100bv (top view) figure 1.6 pin arrangement of h8s/2258 group (tfp-100b, tfp-100bv, fp-100b, fp-100bv: top view)
section 1 overview rev. 5.00 aug 08, 2006 page 10 of 982 rej09b0054-0500 p32/sck0/sda1/ irq4 p33/txd1/scl1 p34/rxd1/sda0 p35/sck1/scl0/ irq5 p36 p77/txd3 p76/rxd3 p75/tmo3/sck3 p74/tmo2/ mres p73/tmo1/ cs7 p72/tmo0/ cs6 p71/tmri23/tmci23/ cs5 p70/tmri01/tmci01/ cs4 pg0/ irq6 pg1/ cs3 / irq7 pg2/ tx / cs2 pg3/ rx / cs1 pg4/ cs0 pe0/d0 pe1/d1 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 pf3/ lwr / adtrg / irq 3 pf2/ wait pf1/ back /buzz pf0/ breq / irq2 p30/txd0 p31/rxd0 pf4/ hwr pf5/ rd pf6/ as pf7/ md2 fwe extal vss xtal vcc stby nmi res osc1 osc2 md1 md0 avcc vref p40/an0 p41/an1 p42/an2 p43/an3 p44/an4 75 74 76 77 78 79 80 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 p45/an5 p46/an6 p47/an7 p97/da1 avss p16/tioca2/ irq1 p15/tiocb1/tclkc p14/tioca1/ irq0 p13/tiocd0/tclkb/a23 p12/tiocc0/tclka/a22 p11/tiocb0/a21 p10/tioca0/a20 pa3/a19/sck2 pa2/a18/rxd2 pa1/a17/txd2 pa0/a16 pb7/a15/tiocb5 pb6/a14/tioca5 p96/da0 p17/tiocb2/tclkd 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 pe2/d2 pe3/d3 pe4/d4 pe5/d5 pe6/d6 pe7/d7 pd0/d8 pd1/d9 pd2/d10 pd3/d11 pd4/d12 cvcc pc0/a0 vss pc1/a1 pc2/a2 pc3/a3 pc4/a4 pc5/a5 pb1/a9/tiocb3 pb2/a10/tiocc3 pb3/a11/tiocd3 pb4/a12/tioca4 pb5/a13/tiocb4 pc7/a7 pb0/a8/tioca3 pd5/d13 pd6/d14 pd7/d15 pc6/a6 fp-100a fp-100av (top view) figure 1.7 pin arrangement of h8s/2258 group (fp-100a, fp-100av: top view)
section 1 overview rev. 5.00 aug 08, 2006 page 11 of 982 rej09b0054-0500 (2) pin arrangement of h8s/2239 group figures 1.8 and 1.9 show the pin arrangement of the h8s/2239 group. p30/txd0 p31/rxd0 p32/sck0/sda1/ irq4 p33/txd1/scl1 p34/rxd1/sda0 p35/sck1/scl0/ irq5 p36 p77/txd3 p76/rxd3 p75/tmo3/sck3 p74/tmo2/ mres p73/tmo1/ tend1 / cs7 p72/tmo0/ tend0 / cs6 p71/tmri23/tmci23/ dreq1 / cs5 p70/tmri01/tmci01/ dreq0 / cs4 pg0/irq6 pg1/ cs3 / irq7 pg2/ cs2 pg3/ cs1 pg4/ cs0 pe0/d0 pe1/d1 pe2/d2 pe3/d3 pe4/d4 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 pf0/ breq / irq2 pf1/ back /buzz pf2/ wait pf3/ lwr / adtrg / irq 3 pf4/ hwr pf5/ rd pf6/ as pf7/ md2 fwe extal vss xtal vcc stby nmi res osc1 osc2 md1 md0 avcc vref p40/an0 p41/an1 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 p42/an2 p43/an3 p44/an4 p45/an5 p46/an6 p47/an7 p96/da0 p97/da1 p17/tiocb2/tclkd p16/tioca2/ irq1 p14/tioca1/ irq0 p13/tiocd0/tclkb/a23 p12/tiocc0/tclka/a22 p11/tiocb0/ dack1 /a21 p10/tioca0/ dack0 /a20 pa3/a19/sck2 pa2/a18/rxd2 pa1/a17/txd2 pa0/a16 pb7/a15/tiocb5 pb6/a14/tioca5 pb5/a13/tiocb4 pb4/a12/tioca4 avss p15/tiocb1/tclkc 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 pe5/d5 pe6/d6 pe7/d7 pd0/d8 pd1/d9 pd2/d10 pd3/d11 pd4/d12 pd5/d13 pd6/d14 pd7/d15 pc1/a1 pc2/a2 pc3/a3 pc4/a4 pc5/a5 pc6/a6 pc7/a7 pb0/a8/tioca3 pb2/a10/tiocc3 pb3/a11/tiocd3 cvcc pc0/a0 vss pb1/a9/tiocb3 tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b fp-100bv (top view) figure 1.8 pin arrangement of h8s/2239 group (tfp-100b, tfp-100bv, tfp-100g, tfp-100gv, fp-100b, fp-100bv: top view)
section 1 overview rev. 5.00 aug 08, 2006 page 12 of 982 rej09b0054-0500 abcde tbp-112a tbp-112av (top view) fghj kl nc (reserve) pf1/ back / buzz pf4/ hwr pf7/ extal xtal stby osc1 md0 p40/an0 nc (reserve) p30/ txd0 nc (reserve) pf2/ wait pf5/ rd fwe vss vcc osc2 avcc p41/an1 p42/an2 p33/ txd1/ scl1 p32/ sck0/ sda1/ irq4 pf0/ breq / irq2 pf3/ lwr/ adtrg / irq3 md2 vcc nmi md1 nc (reserve) p43/an3 p45/an5 p36 p35/ sck1/ scl0/ irq5 p34/ rxd1/ sda0 p31/ rxd0 pf6/ as vss res vref p44/an4 p46/an6 p96/da0 p75/ tmo3/ sck3 p74/ tmo2/ mres p76/ rxd3 p77/ txd3 p47/an7 p97/da1 avss avss p72/ tmo0/ tend0 / cs6 p71/ tmri23/ tmci23/ dreq1 / cs5 p73/ tmo1/ tend1 / cs7 p70/ tmri01/ tmci01/ dreq0 / cs4 p17/ tiocb2/ tclkd p14/ tioca1/ irq0 p16/ tioca2/ irq1 p15/ tiocb1/ tclkc pg0/ irq6 pg1/ cs3/ irq7 pg2/ cs2 pg4/ cs0 p10/ tioca0/ dack0 / a20 p11/ tiocb0/ dack1 / a21 p13/ tiocd0/ tclkb/ a23 p12/ tiocc0/ tclka/ a22 pg3/ cs1 pe0/d0 pe2/d2 pe7/d7 pd5/d13 vss pc5/a5 pb6/ a14/ tioca5 pa1/ a17/ txd2 pa2/ a18/ rxd2 pa3/ a19/ sck2 pe1/d1 pe3/d3 nc (reserve) pd2/d10 pd6/d14 cvcc pc3/a3 pb0/ a8/ tioca3 pb3/ a11/ tiocd3 pb7/ a15/ tiocb5 pa0/a16 pe4/d4 pe5/d5 pd0/d8 pd3/d11 cvcc vss pc2/a2 pc6/a6 pb1/a9/ tiocb3 pb4/ a12/ tioca4 pb5/ a13/ tiocb4 nc (reserve) pe6/d6 pd1/d9 pd4/d12 pd7/d15 pc0/a0 pc1/a1 pc4/a4 pc7/a7 pb2/ a10/ tiocc3 nc (reserve) 11 10 9 8 7 6 5 4 3 2 1 index figure 1.9 pin arrangement of h8s/2239 group (tbp-112a, tbp-112av: top view, only for hd64f2239)
section 1 overview rev. 5.00 aug 08, 2006 page 13 of 982 rej09b0054-0500 (3) pin arrangement of h8s/2238 group figures 1.10 to 1.12 show the pin arrangement of the h8s/2238 group. p30/txd0 p31/rxd0 p32/sck0/sda1/ irq4 p33/txd1/scl1 p34/rxd1/sda0 p35/sck1/scl0/ irq5 p36 p77/txd3 p76/rxd3 p75/tmo3/sck3 p74/tmo2/ mres p73/tmo1/ cs7 p72/tmo0/ cs6 p71/tmri23/tmci23/ cs5 p70/tmri01/tmci01/ cs4 pg0/ irq6 pg1/ cs3 / irq7 pg2/ cs2 pg3/ cs1 pg4/ cs0 pe0/d0 pe1/d1 pe2/d2 pe3/d3 pe4/d4 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 pf0/ breq / irq2 pf1/ back /buzz pf2/ wait pf3/ lwr / adtrg / irq 3 pf4/ hwr pf5/ rd pf6/ as pf7/ md2 fwe extal vss xtal vcc stby nmi res osc1 osc2 md1 md0 avcc vref p40/an0 p41/an1 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 p42/an2 p43/an3 p44/an4 p45/an5 p46/an6 p47/an7 p96/da0 p97/da1 p17/tiocb2/tclkd p16/tioca2/ irq1 p14/tioca1/ irq0 p13/tiocd0/tclkb/a23 p12/tiocc0/tclka/a22 p11/tiocb0/a21 p10/tioca0/a20 pa3/a19/sck2 pa2/a18/rxd2 pa1/a17/txd2 pa0/a16 pb7/a15/tiocb5 pb6/a14/tioca5 pb5/a13/tiocb4 pb4/a12/tioca4 avss p15/tiocb1/tclkc 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 pe5/d5 pe6/d6 pe7/d7 pd0/d8 pd1/d9 pd2/d10 pd3/d11 pd4/d12 pd5/d13 pd6/d14 pd7/d15 pc1/a1 pc2/a2 pc3/a3 pc4/a4 pc5/a5 pc6/a6 pc7/a7 pb0/a8/tioca3 pb2/a10/tiocc3 pb3/a11/tiocd3 cvcc pc0/a0 vss pb1/a9/tiocb3 tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b fp-100bv (top view) figure 1.10 pin arrangement of h8s/2238 group (tfp-100b, tfp-100bv, tfp-100g, tfp-100gv, fp-100b, fp-100bv: top view)
section 1 overview rev. 5.00 aug 08, 2006 page 14 of 982 rej09b0054-0500 p32/sck0/sda1/ irq4 p33/txd1/scl1 p34/rxd1/sda0 p35/sck1/scl0/ irq5 p36 p77/txd3 p76/rxd3 p75/tmo3/sck3 p74/tmo2/ mres p73/tmo1/ cs7 p72/tmo0/ cs6 p71/tmri23/tmci23/ cs5 p70/tmri01/tmci01/ cs4 pg0/ irq6 pg1/ cs3 / irq7 pg2/ cs2 pg3/ cs1 pg4/ cs0 pe0/d0 pe1/d1 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 pf3/ lwr / adtrg / irq 3 pf2/ wait pf1/ back /buzz pf0/ breq / irq2 p30/txd0 p31/rxd0 pf4/ hwr pf5/ rd pf6/ as pf7/ md2 fwe extal vss xtal vcc stby nmi res osc1 osc2 md1 md0 avcc vref p40/an0 p41/an1 p42/an2 p43/an3 p44/an4 75 74 76 77 78 79 80 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 p45/an5 p46/an6 p47/an7 p97/da1 avss p16/tioca2/ irq1 p15/tiocb1/tclkc p14/tioca1/ irq0 p13/tiocd0/tclkb/a23 p12/tiocc0/tclka/a22 p11/tiocb0/a21 p10/tioca0/a20 pa3/a19/sck2 pa2/a18/rxd2 pa1/a17/txd2 pa0/a16 pb7/a15/tiocb5 pb6/a14/tioca5 p96/da0 p17/tiocb2/tclkd 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 pe2/d2 pe3/d3 pe4/d4 pe5/d5 pe6/d6 pe7/d7 pd0/d8 pd1/d9 pd2/d10 pd3/d11 pd4/d12 vcc pc0/a0 vss pc1/a1 pc2/a2 pc3/a3 pc4/a4 pc5/a5 pb1/a9/tiocb3 pb2/a10/tiocc3 pb3/a11/tiocd3 pb4/a12/tioca4 pb5/a13/tiocb4 pc7/a7 pb0/a8/tioca3 pd5/d13 pd6/d14 pd7/d15 pc6/a6 fp-100a fp-100av (top view) figure 1.11 pin arrangement of h8s/2238 group (fp-100a, fp-100av: top view, only for h8s/2238b and h8s/2236b)
section 1 overview rev. 5.00 aug 08, 2006 page 15 of 982 rej09b0054-0500 abcde bp-112 bp-112v tbp-112a tbp-112av (top view) fghj kl nc pf1/ back / buzz pf4/ hwr pf7/ extal xtal stby osc1 md0 p40/an0 nc p30/ txd0 nc pf2/ wait pf5/ rd fwe vss vcc osc2 avcc p41/an1 p42/an2 p33/ txd1/ scl1 p32/ sck0/ sda1/ irq4 pf0/ breq / irq2 pf3/l wr/ adtrg / irq3 md2 vcc nmi md1 nc p43/an3 p45/an5 p36 p35/ sck1/ scl0/ irq5 p34/ rxd1/ sda0 p31/ rxd0 pf6/ as vss res vref p44/an4 p46/an6 p96/da0 p75/ tmo3/ sck3 p74/ tmo2/ mres p76/ rxd3 p77/ txd3 p47/an7 p97/da1 avss avss p72/ tmo0/ cs6 p71/ tmri23/ tmci23/ cs5 p73/ tmo1/ cs7 p70/ tmri01/ tmci01/ cs4 p17/ tiocb2/ tclkd p14/ tioca1/ irq0 p16/ tioca2/ irq1 p15/ tiocb1/ tclkc pg0/ irq6 pg1/ cs3/ irq7 pg2/ cs2 pg4/ cs0 p10/ tioca0/ a20 p11/ tiocb0/ a21 p13/ tiocd0/ tclkb/ a23 p12/ tiocc0/ tclka/ a22 pg3/ cs1 pe0/d0 pe2/d2 pe7/d7 pd5/d13 vss pc5/a5 pb6/ a14/ tioca5 pa1/ a17/ txd2 pa2/ a18/ rxd2 pa3/ a19/ sck2 pe1/d1 pe3/d3 nc pd2/d10 pd6/d14 cvcc pc3/a3 pb0/ a8/ tioca3 pb3/ a11/ tiocd3 pb7/ a15/ tiocb5 pa0/a16 pe4/d4 pe5/d5 pd0/d8 pd3/d11 cvcc vss pc2/a2 pc6/a6 pb1/a9/ tiocb3 pb4/ a12/ tioca4 pb5/ a13/ tiocb4 nc pe6/d6 pd1/d9 pd4/d12 pd7/d15 pc0/a0 pc1/a1 pc4/a4 pc7/a7 pb2/ a10/ tiocc3 nc 11 10 9 8 7 6 5 4 3 2 1 index figure 1.12 pin arrangement of h8s/2238 group (bp-112, bp-112v, tbp-112a, tbp-112av: top view, only for hd64f2238r)
section 1 overview rev. 5.00 aug 08, 2006 page 16 of 982 rej09b0054-0500 (4) pin arrangement of h8s/2237 group figures 1.13 and 1.14 show the pin arrangement of the h8s/2237 group. p30/txd0 p31/rxd0 p32/sck0/ irq4 p33/txd1 p34/rxd1 p35/sck1/ irq5 p36 p77/txd3 p76/rxd3 p75/sck3 p74/ mres p73/tmo1/ cs7 p72/tmo0/ cs6 p71/ cs5 p70/tmri01/tmci01/ cs4 pg0/ irq6 pg1/ cs3 / irq7 pg2/ cs2 pg3/ cs1 pg4/ cs0 pe0/d0 pe1/d1 pe2/d2 pe3/d3 pe4/d4 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 pf0/ breq / irq2 pf1/ back /buzz pf2/ wait pf3/ lwr / adtrg / irq 3 pf4/ hwr pf5/ rd pf6/ as pf7/ md2 fwe extal vss xtal vcc stby nmi res osc1 osc2 md1 md0 avcc vref p40/an0 p41/an1 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 p42/an2 p43/an3 p44/an4 p45/an5 p46/an6 p47/an7 p96/da0 p97/da1 p17/tiocb2/tclkd p16/tioca2/ irq1 p14/tioca1/ irq0 p13/tiocd0/tclkb/a23 p12/tiocc0/tclka/a22 p11/tiocb0/a21 p10/tioca0/a20 pa3/a19/sck2 pa2/a18/rxd2 pa1/a17/txd2 pa0/a16 pb7/a15/tiocb5 pb6/a14/tioca5 pb5/a13/tiocb4 pb4/a12/tioca4 avss p15/tiocb1/tclkc 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 pe5/d5 pe6/d6 pe7/d7 pd0/d8 pd1/d9 pd2/d10 pd3/d11 pd4/d12 pd5/d13 pd6/d14 pd7/d15 pc1/a1 pc2/a2 pc3/a3 pc4/a4 pc5/a5 pc6/a6 pc7/a7 pb0/a8/tioca3 pb2/a10/tiocc3 pb3/a11/tiocd3 vcc pc0/a0 vss pb1/a9/tiocb3 tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b fp-100bv (top view) figure 1.13 pin arrangement of h8s/2237 group (tfp-100b, tfp-100bv, tfp-100g, tfp-100gv, fp-100b, fp-100bv: top view)
section 1 overview rev. 5.00 aug 08, 2006 page 17 of 982 rej09b0054-0500 p32/sck0/ irq4 p33/txd1 p34/rxd1 p35/sck1/ irq5 p36 p77/txd3 p76/rxd3 p75/sck3 p74/ mres p73/tmo1/ cs7 p72/tmo0/ cs6 p71/ cs5 p70/tmri01/tmci01/ cs4 pg0/ irq6 pg1/ cs3 / irq7 pg2/ cs2 pg3/ cs1 pg4/ cs0 pe0/d0 pe1/d1 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 pf3/ lwr / adtrg / irq 3 pf2/ wait pf1/ back /buzz pf0/ breq / irq2 p30/txd0 p31/rxd0 pf4/ hwr pf5/ rd pf6/ as pf7/ md2 fwe extal vss xtal vcc stby nmi res osc1 osc2 md1 md0 avcc vref p40/an0 p41/an1 p42/an2 p43/an3 p44/an4 75 74 76 77 78 79 80 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 p45/an5 p46/an6 p47/an7 p97/da1 avss p16/tioca2/ irq1 p15/tiocb1/tclkc p14/tioca1/ irq0 p13/tiocd0/tclkb/a23 p12/tiocc0/tclka/a22 p11/tiocb0/a21 p10/tioca0/a20 pa3/a19/sck2 pa2/a18/rxd2 pa1/a17/txd2 pa0/a16 pb7/a15/tiocb5 pb6/a14/tioca5 p96/da0 p17/tiocb2/tclkd 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 pe2/d2 pe3/d3 pe4/d4 pe5/d5 pe6/d6 pe7/d7 pd0/d8 pd1/d9 pd2/d10 pd3/d11 pd4/d12 vcc pc0/a0 vss pc1/a1 pc2/a2 pc3/a3 pc4/a4 pc5/a5 pb1/a9/tiocb3 pb2/a10/tiocc3 pb3/a11/tiocd3 pb4/a12/tioca4 pb5/a13/tiocb4 pc7/a7 pb0/a8/tioca3 pd5/d13 pd6/d14 pd7/d15 pc6/a6 fp-100a fp-100av (top view) figure 1.14 pin arrangement of h8s/2237 group (fp-100a, fp-100av: top view)
section 1 overview rev. 5.00 aug 08, 2006 page 18 of 982 rej09b0054-0500 (5) pin arrangement of h8s/2227 group figures 1.15 and 1.16 show the pin arrangement of the h8s/2227 group. p30/txd0 p31/rxd0 p32/sck0/ irq4 p33/txd1 p34/rxd1 p35/sck1/ irq5 p36 p77/txd3 p76/rxd3 p75/sck3 p74/ mres p73/tmo1/ cs7 p72/tmo0/ cs6 p71/ cs5 p70/tmri01/tmci01/ cs4 note: * masked rom version only. pg0/ irq6 pg1/ cs3 / irq7 pg2/ cs2 pg3/ cs1 pg4/ cs0 pe0/d0 pe1/d1 pe2/d2 pe3/d3 pe4/d4 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 pf0/ breq / irq2 pf1/ back /buzz pf2/ wait pf3/ lwr / adtrg / irq 3 pf4/ hwr pf5/ rd pf6/ as pf7/ md2 fwe extal vss xtal vcc stby nmi res osc1 osc2 md1 md0 avcc vref p40/an0 p41/an1 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 p42/an2 p43/an3 p44/an4 p45/an5 p46/an6 p47/an7 p96 p97 p17/tiocb2/tclkd p16/tioca2/ irq1 p14/tioca1/ irq0 p13/tiocd0/tclkb/a23 p12/tiocc0/tclka/a22 p11/tiocb0/a21 p10/tioca0/a20 pa3/a19 pa2/a18 pa1/a17 pa0/a16 pb7/a15 pb6/a14 pb5/a13 pb4/a12 avss p15/tiocb1/tclkc 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 pe5/d5 pe6/d6 pe7/d7 pd0/d8 pd1/d9 pd2/d10 pd3/d11 pd4/d12 pd5/d13 pd6/d14 pd7/d15 pc1/a1 pc2/a2 pc3/a3 pc4/a4 pc5/a5 pc6/a6 pc7/a7 pb0/a8 pb2/a10 pb3/a11 vcc pc0/a0 vss pb1/a9 tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b * fp-100bv * (top view) figure 1.15 pin arrangement of h8s/2227 group (tfp-100b, tfp-100bv, tfp-100g, tfp-100gv, fp-100b * , fp-100bv * : top view)
section 1 overview rev. 5.00 aug 08, 2006 page 19 of 982 rej09b0054-0500 p32/sck0/ irq4 p33/txd1 p34/rxd1 p35/sck1/ irq5 p36 p77/txd3 p76/rxd3 p75/sck3 p74/ mres p73/tmo1/ cs7 p72/tmo0/ cs6 p71/ cs5 p70/tmri01/tmci01/ cs4 pg0/ irq6 pg1/ cs3 / irq7 pg2/ cs2 pg3/ cs1 pg4/cs0 pe0/d0 pe1/d1 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 pf3/ lwr / adtrg / irq 3 pf2/ wait pf1/ back /buzz pf0/ breq / irq2 p30/txd0 p31/rxd0 pf4/ hwr pf5/ rd pf6/ as pf7/ md2 fwe extal vss xtal vcc stby nmi res osc1 osc2 md1 md0 avcc vref p40/an0 p41/an1 p42/an2 p43/an3 p44/an4 75 74 76 77 78 79 80 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 p45/an5 p46/an6 p47/an7 p97 avss p16/tioca2/ irq1 p15/tiocb1/tclkc p14/tioca1/ irq0 p13/tiocd0/tclkb/a23 p12/tiocc0/tclka/a22 p11/tiocb0/a21 p10/tioca0/a20 pa3/a19 pa2/a18 pa1/a17 pa0/a16 pb7/a15 pb6/a14 p96 p17/tiocb2/tclkd 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 pe2/d2 pe3/d3 pe4/d4 pe5/d5 pe6/d6 pe7/d7 pd0/d8 pd1/d9 pd2/d10 pd3/d11 pd4/d12 vcc pc0/a0 vss pc1/a1 pc2/a2 pc3/a3 pc4/a4 pc5/a5 pb1/a9 pb2/a10 pb3/a11 pb4/a12 pb5/a13 pc7/a7 pb0/a8 pd5/d13 pd6/d14 pd7/d15 pc6/a6 fp-100a fp-100av (top view) figure 1.16 pin arrangement of h8s/2227 group (fp-100a, fp-100av: top view, only for hd6432227)
section 1 overview rev. 5.00 aug 08, 2006 page 20 of 982 rej09b0054-0500 1.3.2 pin arrangements in each mode tables 1.1 to 1.5 show the pin arrangements in each mode. table 1.1 pin arrangements in each mode of h8s/2258 group pin no. pin name tfp- 100b fp- 100b fp- 100a mode 4 mode 5 mode 6 mode 7 flash memory programmable mode 1 4 pe5/d5 pe5/d5 pe5/d5 pe5 oe 2 5 pe6/d6 pe6/d6 pe6/d6 pe6 we 3 6 pe7/d7 pe7/d7 pe7/d7 pe7 ce 4 7 d8 d8 d8 pd0 d0 5 8 d9 d9 d9 pd1 d1 6 9 d10 d10 d10 pd2 d2 7 10 d11 d11 d11 pd3 d3 8 11 d12 d12 d12 pd4 d4 9 12 d13 d13 d13 pd5 d5 10 13 d14 d14 d14 pd6 d6 11 14 d15 d15 d15 pd7 d7 12 15 cvcc cvcc cvcc cvcc vcc 13 16 a0 a0 pc0/a0 pc0 a0 14 17 vss vss vss vss vss 15 18 a1 a1 pc1/a1 pc1 a1 16 19 a2 a2 pc2/a2 pc2 a2 17 20 a3 a3 pc3/a3 pc3 a3 18 21 a4 a4 pc4/a4 pc4 a4 19 22 a5 a5 pc5/a5 pc5 a5 20 23 a6 a6 pc6/a6 pc6 a6 21 24 a7 a7 pc7/a7 pc7 a7 22 25 pb0/a8/tioca3 pb0/a8/tioca3 pb0/a8/tioca3 pb0/tioca3 a8 23 26 pb1/a9/tiocb3 pb1/a9/tiocb3 pb1/a9/tiocb3 pb1/tiocb3 a9 24 27 pb2/a10/ tiocc3 pb2/a10/ tiocc3 pb2/a10/ tiocc3 pb2/tiocc3 a10 25 28 pb3/a11/ tiocd3 pb3/a11/ tiocd3 pb3/a11/ tiocd3 pb3/tiocd3 a11
section 1 overview rev. 5.00 aug 08, 2006 page 21 of 982 rej09b0054-0500 pin no. pin name tfp- 100b fp- 100b fp- 100a mode 4 mode 5 mode 6 mode 7 flash memory programmable mode 26 29 pb4/a12/ tioca4 pb4/a12/ tioca4 pb4/a12/ tioca4 pb4/tioca4 a12 27 30 pb5/a13/ tiocb4 pb5/a13/ tiocb4 pb5/a13/ tiocb4 pb5/tiocb4 a13 28 31 pb6/a14/ tioca5 pb6/a14/ tioca5 pb6/a14/ tioca5 pb6/tioca5 a14 29 32 pb7/a15/ tiocb5 pb7/a15/ tiocb5 pb7/a15/ tiocb5 pb7/tiocb5 a15 30 33 pa0/a16 pa0/a16 pa0/a16 pa0 a16 31 34 pa1/a17/txd2 pa1/a17/txd2 pa1/a17/txd2 pa1/txd2 a17 32 35 pa2/a18/rxd2 pa2/a18/rxd2 pa2/a18/rxd2 pa2/rxd2 a18 33 36 pa3/a19/ sck2 pa3/a19/ sck2 pa3/a19/ sck2 pa3/sck2 nc 34 37 p10/tioca0/ a20 p10/tioca0/ a20 p10/tioca0/ a20 p10/tioca0 nc 35 38 p11/tiocb0/ a21 p11/tiocb0/ a21 p11/tiocb0/ a21 p11/tiocb0 nc 36 39 p12/tiocc0/ tclka/a22 p12/tiocc0/ tclka/a22 p12/tiocc0/ tclka/a22 p12/tiocc0/ tclka nc 37 40 p13/tiocd0/ tclkb/a23 p13/tiocd0/ tclkb/a23 p13/tiocd0/ tclkb/a23 p13/tiocd0/ tclkb nc 38 41 p14/tioca1/ irq0 p14/tioca1/ irq0 p14/tioca1/ irq0 p14/tioca1/ irq0 vss 39 42 p15/tiocb1/ tclkc p15/tiocb1/ tclkc p15/tiocb1/ tclkc p15/tiocb1/ tclkc nc 40 43 p16/tioca2/ irq1 p16/tioca2/ irq1 p16/tioca2/ irq1 p16/tioca2/ irq1 vss 41 44 p17/tiocb2/ tclkd p17/tiocb2/ tclkd p17/tiocb2/ tclkd p17/tiocb2/ tclkd nc 42 45 avss avss avss avss vss 43 46 p97/da1 p97/da1 p97/da1 p97/da1 nc 44 47 p96/da0 p96/da0 p96/da0 p96/da0 nc 45 48 p47/an7 p47/an7 p47/an7 p47/an7 nc 46 49 p46/an6 p46/an6 p46/an6 p46/an6 nc 47 50 p45/an5 p45/an5 p45/an5 p45/an5 nc 48 51 p44/an4 p44/an4 p44/an4 p44/an4 nc
section 1 overview rev. 5.00 aug 08, 2006 page 22 of 982 rej09b0054-0500 pin no. pin name tfp- 100b fp- 100b fp- 100a mode 4 mode 5 mode 6 mode 7 flash memory programmable mode 49 52 p43/an3 p43/an3 p43/an3 p43/an3 nc 50 53 p42/an2 p42/an2 p42/an2 p42/an2 nc 51 54 p41/an1 p41/an1 p41/an1 p41/an1 nc 52 55 p40/an0 p40/an0 p40/an0 p40/an0 nc 53 56 vref vref vref vref vcc 54 57 avcc avcc avcc avcc vcc 55 58 md0 md0 md0 md0 vss 56 59 md1 md1 md1 md1 vss 57 60 osc2 osc2 osc2 osc2 nc 58 61 osc1 osc1 osc1 osc1 vss 59 62 res res res res res 60 63 nmi nmi nmi nmi vcc 61 64 stby stby stby stby vcc 62 65 vcc vcc vcc vcc vcc 63 66 xtal xtal xtal xtal xtal 64 67 vss vss vss vss vss 65 68 extal extal extal extal extal 66 69 fwe fwe fwe fwe fwe 67 70 md2 md2 md2 md2 vss 68 71 pf7/ pf7/ pf7/ pf7/ nc 69 72 as as as pf6 nc 70 73 rd rd rd pf5 nc 71 74 hwr hwr hwr pf4 nc 72 75 pf3/ lwr / adtrg / irq3 pf3/ lwr / adtrg / irq3 pf3/ lwr / adtrg / irq3 pf3/ adtrg / irq3 nc 73 76 pf2/ wait pf2/ wait pf2/ wait pf2 nc 74 77 pf1/ back / buzz pf1/ back / buzz pf1/ back / buzz pf1/buzz nc 75 78 pf0/ breq / irq2 pf0/ breq / irq2 pf0/ breq / irq2 pf0/ irq2 vcc 76 79 p30/txd0 p30/txd0 p30/txd0 p30/txd0 nc 77 80 p31/rxd0 p31/rxd0 p31/rxd0 p31/rxd0 nc
section 1 overview rev. 5.00 aug 08, 2006 page 23 of 982 rej09b0054-0500 pin no. pin name tfp- 100b fp- 100b fp- 100a mode 4 mode 5 mode 6 mode 7 flash memory programmable mode 78 81 p32/sck0/ sda1/ irq4 p32/sck0/ sda1/ irq4 p32/sck0/ sda1/ irq4 p32/sck0/ sda1/ irq4 nc 79 82 p33/txd1/ scl1 p33/txd1/ scl1 p33/txd1/ scl1 p33/txd1/ scl1 nc 80 83 p34/rxd1/ sda0 p34/rxd1/ sda0 p34/rxd1/ sda0 p34/rxd1/ sda0 nc 81 84 p35/sck1/ scl0/ irq5 p35/sck1/ scl0/ irq5 p35/sck1/ scl0/ irq5 p35/sck1/ scl0/ irq5 nc 82 85 p36 p36 p36 p36 nc 83 86 p77/txd3 p77/txd3 p77/txd3 p77/txd3 nc 84 87 p76/rxd3 p76/rxd3 p76/rxd3 p76/rxd3 nc 85 88 p75/tmo3/ sck3 p75/tmo3/ sck3 p75/tmo3/ sck3 p75/tmo3/ sck3 nc 86 89 p74/tmo2/ mres p74/tmo2/ mres p74/tmo2/ mres p74/tmo2/ mres nc 87 90 p73/tmo1/ cs7 p73/tmo1/ cs7 p73/tmo1/ cs7 p73/tmo1 nc 88 91 p72/tmo0/ cs6 p72/tmo0/ cs6 p72/tmo0/ cs6 p72/tmo0 nc 89 92 p71/tmri23/ tmci23/ cs5 p71/tmri23/ tmci23/ cs5 p71/tmri23/ tmci23/ cs5 p71/tmri23/ tmci23 nc 90 93 p70/tmri01/ tmci01/ cs4 p70/tmri01/ tmci01/ cs4 p70/tmri01/ tmci01/ cs4 p70/tmri01/ tmci01 nc 91 94 pg0/ irq6 pg0/ irq6 pg0/ irq6 pg0/ irq6 nc 92 95 pg1/ cs3 / irq7 pg1/ cs3 / irq7 pg1/ cs3 / irq7 pg1/ irq7 nc 93 96 pg2/ tx / cs2 pg2/ tx / cs2 pg2/ tx / cs2 pg2/ tx nc 94 97 pg3/ rx / cs1 pg3/ rx / cs1 pg3/ rx / cs1 pg3/ rx nc 95 98 pg4/ cs0 pg4/ cs0 pg4/ cs0 pg4 nc 96 99 pe0/d0 pe0/d0 pe0/d0 pe0 nc 97 100 pe1/d1 pe1/d1 pe1/d1 pe1 nc 98 1 pe2/d2 pe2/d2 pe2/d2 pe2 nc 99 2 pe3/d3 pe3/d3 pe3/d3 pe3 vcc 100 3 pe4/d4 pe4/d4 pe4/d4 pe4 vss
section 1 overview rev. 5.00 aug 08, 2006 page 24 of 982 rej09b0054-0500 table 1.2 pin arrangements in each mode of h8s/2239 group pin no. pin name tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b fp-100bv tbp-112a * tbp-112av * mode 4 mode 5 mode 6 mode 7 flash memory programmable mode 1 b2 pe5/d5 pe5/d5 pe5/d5 pe5 oe 2 b1 pe6/d6 pe6/d6 pe6/d6 pe6 we 3 d4 pe7/d7 pe7/d7 pe7/d7 pe7 ce 4c2 d8d8d8pd0d0 5c1 d9d9d9pd1d1 6 d3 d10 d10 d10 pd2 d2 7 d2 d11 d11 d11 pd3 d3 8 d1 d12 d12 d12 pd4 d4 9 e4 d13 d13 d13 pd5 d5 10 e3 d14 d14 d14 pd6 d6 11 e1 d15 d15 d15 pd7 d7 12 e2, f3 cvcc cvcc cvcc cvcc vcc 13 f1 a0 a0 pc0/a0 pc0 a0 14 f2, f4 vss vss vss vss vss 15 g1 a1 a1 pc1/a1 pc1 a1 16 g2 a2 a2 pc2/a2 pc2 a2 17 g3 a3 a3 pc3/a3 pc3 a3 18 h1 a4 a4 pc4/a4 pc4 a4 19 g4 a5 a5 pc5/a5 pc5 a5 20 h2 a6 a6 pc6/a6 pc6 a6 21 j1 a7 a7 pc7/a7 pc7 a7 22 h3 pb0/a8/ tioca3 pb0/a8/ tioca3 pb0/a8/ tioca3 pb0/tioca3 a8 23 j2 pb1/a9/ tiocb3 pb1/a9/ tiocb3 pb1/a9/ tiocb3 pb1/tiocb3 a9 24 k1 pb2/a10/ tiocc3 pb2/a10/ tiocc3 pb2/a10/ tiocc3 pb2/tiocc3 a10 25 j3 pb3/a11/ tiocd3 pb3/a11/ tiocd3 pb3/a11/ tiocd3 pb3/tiocd3 a11 26 k2 pb4/a12/ tioca4 pb4/a12/ tioca4 pb4/a12/ tioca4 pb4/tioca4 a12
section 1 overview rev. 5.00 aug 08, 2006 page 25 of 982 rej09b0054-0500 pin no. pin name tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b fp-100bv tbp-112a * tbp-112av * mode 4 mode 5 mode 6 mode 7 flash memory programmable mode 27 l2 pb5/a13/ tiocb4 pb5/a13/ tiocb4 pb5/a13/ tiocb4 pb5/tiocb4 a13 28 h4 pb6/a14/ tioca5 pb6/a14/ tioca5 pb6/a14/ tioca5 pb6/tioca5 a14 29 k3 pb7/a15/ tiocb5 pb7/a15/ tiocb5 pb7/a15/ tiocb5 pb7/tiocb5 a15 30 l3 pa0/a16 pa0/a16 pa0/a16 pa0 a16 31 j4 pa1/a17/ txd2 pa1/a17/ txd2 pa1/a17/ txd2 pa1/txd2 a17 32 k4 pa2/a18/ rxd2 pa2/a18/ rxd2 pa2/a18/ rxd2 pa2/rxd2 a18 33 l4 pa3/a19/ sck2 pa3/a19/ sck2 pa3/a19/ sck2 pa3/sck2 nc 34 h5 p10/tioca0/ dack0 /a20 p10/tioca0/ dack0 /a20 p10/tioca0/ dack0 /a20 p10/tioca0/ dack0 nc 35 j5 p11/tiocb0/ dack1 /a21 p11/tiocb0/ dack1 /a21 p11/tiocb0/ dack1 /a21 p11/tiocb0/ dack1 nc 36 l5 p12/tiocc0/ tclka/a22 p12/tiocc0/ tclka/a22 p12/tiocc0/ tclka/a22 p12/tiocc0/ tclka nc 37 k5 p13/tiocd0/ tclkb/a23 p13/tiocd0/ tclkb/a23 p13/tiocd0/ tclkb/a23 p13/tiocd0/ tclkb nc 38 j6 p14/tioca1/ irq0 p14/tioca1/ irq0 p14/tioca1/ irq0 p14/tioca1/ irq0 vss 39 l6 p15/tiocb1/ tclkc p15/tiocb1/ tclkc p15/tiocb1/ tclkc p15/tiocb1/ tclkc nc 40 k6 p16/tioca2/ irq1 p16/tioca2/ irq1 p16/tioca2/ irq1 p16/tioca2/ irq1 vss 41 h6 p17/tiocb2/ tclkd p17/tiocb2/ tclkd p17/tiocb2/ tclkd p17/tiocb2/ tclkd nc 42 k7, l7 avss avss avss avss vss 43 j7 p97/da1 p97/da1 p97/da1 p97/da1 nc 44 l8 p96/da0 p96/da0 p96/da0 p96/da0 nc 45 h7 p47/an7 p47/an7 p47/an7 p47/an7 nc 46 k8 p46/an6 p46/an6 p46/an6 p46/an6 nc 47 l9 p45/an5 p45/an5 p45/an5 p45/an5 nc
section 1 overview rev. 5.00 aug 08, 2006 page 26 of 982 rej09b0054-0500 pin no. pin name tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b fp-100bv tbp-112a * tbp-112av * mode 4 mode 5 mode 6 mode 7 flash memory programmable mode 48 j8 p44/an4 p44/an4 p44/an4 p44/an4 nc 49 k9 p43/an3 p43/an3 p43/an3 p43/an3 nc 50 l10 p42/an2 p42/an2 p42/an2 p42/an2 nc 51 k10 p41/an1 p41/an1 p41/an1 p41/an1 nc 52 k11 p40/an0 p40/an0 p40/an0 p40/an0 nc 53 h8 vref vref vref vref vcc 54 j10 avcc avcc avcc avcc vcc 55 j11 md0 md0 md0 md0 vss 56 h9 md1 md1 md1 md1 vss 57 h10 osc2osc2osc2osc2nc 58 h11 osc1osc1osc1osc1vss 59 g8 res res res res res 60g9 nminminminmivcc 61 g11 stby stby stby stby vcc 62 f9, g10 vcc vcc vcc vcc vcc 63 f11 xtal xtal xtal xtal xtal 64 f8, f10 vss vss vss vss vss 65 e11 extal extal extal extal extal 66 e10 fwe fwe fwe fwe fwe 67 e9 md2 md2 md2 md2 vss 68 d11 pf7/ pf7/ pf7/ pf7/ nc 69 e8 as as as pf6 nc 70 d10 rd rd rd pf5 nc 71 c11 hwr hwr hwr pf4 nc 72 d9 pf3/ lwr / adtrg / irq3 pf3/ lwr / adtrg / irq3 pf3/ lwr / adtrg / irq3 pf3/ adtrg / irq3 nc 73 c10 pf2/ wait pf2/ wait pf2/ wait pf2 nc 74 b11 pf1/ back / buzz pf1/ back / buzz pf1/ back / buzz pf1/buzz nc 75 c9 pf0/ breq / irq2 pf0/ breq / irq2 pf0/ breq / irq2 pf0/ irq2 vcc
section 1 overview rev. 5.00 aug 08, 2006 page 27 of 982 rej09b0054-0500 pin no. pin name tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b fp-100bv tbp-112a * tbp-112av * mode 4 mode 5 mode 6 mode 7 flash memory programmable mode 76 a10 p30/txd0 p30/txd0 p30/txd0 p30/txd0 nc 77 d8 p31/rxd0 p31/rxd0 p31/rxd0 p31/rxd0 nc 78 b9 p32/sck0/ sda1/ irq4 p32/sck0/ sda1/ irq4 p32/sck0/ sda1/ irq4 p32/sck0/ sda1/ irq4 nc 79 a9 p33/txd1/ scl1 p33/txd1/ scl1 p33/txd1/ scl1 p33/txd1/ scl1 nc 80 c8 p34/rxd1/ sda0 p34/rxd1/ sda0 p34/rxd1/ sda0 p34/rxd1/ sda0 nc 81 b8 p35/sck1/ scl0/ irq5 p35/sck1/ scl0/ irq5 p35/sck1/ scl0/ irq5 p35/sck1/ scl0/ irq5 nc 82 a8 p36 p36 p36 p36 nc 83 d7 p77/txd3 p77/txd3 p77/txd3 p77/txd3 nc 84 c7 p76/rxd3 p76/rxd3 p76/rxd3 p76/rxd3 nc 85 a7 p75/tmo3/ sck3 p75/tmo3/ sck3 p75/tmo3/ sck3 p75/tmo3/ sck3 nc 86 b7 p74/tmo2/ mres p74/tmo2/ mres p74/tmo2/ mres p74/tmo2/ mres nc 87 c6 p73/tmo1/ tend1 / cs7 p73/tmo1/ tend1 / cs7 p73/tmo1/ tend1 / cs7 p73/tmo1/ tend1 nc 88 a6 p72/tmo0/ tend0 / cs6 p72/tmo0/ tend0 / cs6 p72/tmo0/ tend0 / cs6 p72/tmo0/ tend0 nc 89 b6 p71/tmri23/ tmci23/ dreq1 / cs5 p71/tmri23/ tmci23/ dreq1 / cs5 p71/tmri23/ tmci23/ dreq1 / cs5 p71/tmri23/ tmci23/ dreq1 nc 90 d6 p70/tmri01/ tmci01/ dreq0 / cs4 p70/tmri01/ tmci01/ dreq0 / cs4 p70/tmri01/ tmci01/ dreq0 / cs4 p70/tmri01/ tmci01/ dreq0 nc 91 a5 pg0/ irq6 pg0/ irq6 pg0/ irq6 pg0/ irq6 nc 92 b5 pg1/ cs3 / irq7 pg1/ cs3 / irq7 pg1/ cs3 / irq7 pg1/ irq7 nc 93 c5 pg2/ cs2 pg2/ cs2 pg2/ cs2 pg2 nc 94 a4 pg3/ cs1 pg3/ cs1 pg3/ cs1 pg3 nc 95 d5 pg4/ cs0 pg4/ cs0 pg4/ cs0 pg4 nc 96 b4 pe0/d0 pe0/d0 pe0/d0 pe0 nc 97 a3 pe1/d1 pe1/d1 pe1/d1 pe1 nc
section 1 overview rev. 5.00 aug 08, 2006 page 28 of 982 rej09b0054-0500 pin no. pin name tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b fp-100bv tbp-112a * tbp-112av * mode 4 mode 5 mode 6 mode 7 flash memory programmable mode 98 c4 pe2/d2 pe2/d2 pe2/d2 pe2 nc 99 b3 pe3/d3 pe3/d3 pe3/d3 pe3 vcc 100 a2 pe4/d4 pe4/d4 pe4/d4 pe4 vss note: * supported only by hd64f2239.
section 1 overview rev. 5.00 aug 08, 2006 page 29 of 982 rej09b0054-0500 table 1.3 pin arrangements in each mode of h8s/2238 group pin no. pin name tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b fp-100bv fp-100a * 1 fp-100av * 1 bp-112 * 2 bp-112v * 2 tbp-112a * 2 tbp- 112av * 2 mode 4 mode 5 mode 6 mode 7 flash memory programmable mode 1 4 b2 pe5/d5 pe5/d5 pe5/d5 pe5 oe 2 5 b1 pe6/d6 pe6/d6 pe6/d6 pe6 we 3 6 d4 pe7/d7 pe7/d7 pe7/d7 pe7 ce 4 7 c2 d8 d8 d8 pd0 d0 5 8 c1 d9 d9 d9 pd1 d1 6 9 d3 d10 d10 d10 pd2 d2 7 10 d2 d11 d11 d11 pd3 d3 8 11 d1 d12 d12 d12 pd4 d4 9 12 e4 d13 d13 d13 pd5 d5 10 13 e3 d14 d14 d14 pd6 d6 11 14 e1 d15 d15 d15 pd7 d7 12 15 e2, f3 cvcc cvcc cvcc cvcc vcc 13 16 f1 a0 a0 pc0/a0 pc0 a0 14 17 f2, f4 vss vss vss vss vss 15 18 g1 a1 a1 pc1/a1 pc1 a1 16 19 g2 a2 a2 pc2/a2 pc2 a2 17 20 g3 a3 a3 pc3/a3 pc3 a3 18 21 h1 a4 a4 pc4/a4 pc4 a4 19 22 g4 a5 a5 pc5/a5 pc5 a5 20 23 h2 a6 a6 pc6/a6 pc6 a6 21 24 j1 a7 a7 pc7/a7 pc7 a7 22 25 h3 pb0/a8/ tioca3 pb0/a8/ tioca3 pb0/a8/ tioca3 pb0/ tioca3 a8 23 26 j2 pb1/a9/ tiocb3 pb1/a9/ tiocb3 pb1/a9/ tiocb3 pb1/ tiocb3 a9 24 27 k1 pb2/a10/ tiocc3 pb2/a10/ tiocc3 pb2/a10/ tiocc3 pb2/ tiocc3 a10 25 28 j3 pb3/a11/ tiocd3 pb3/a11/ tiocd3 pb3/a11/ tiocd3 pb3/ tiocd3 a11 26 29 k2 pb4/a12/ tioca4 pb4/a12/ tioca4 pb4/a12/ tioca4 pb4/ tioca4 a12
section 1 overview rev. 5.00 aug 08, 2006 page 30 of 982 rej09b0054-0500 pin no. pin name tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b fp-100bv fp-100a * 1 fp-100av * 1 bp-112 * 2 bp-112v * 2 tbp-112a * 2 tbp- 112av * 2 mode 4 mode 5 mode 6 mode 7 flash memory programmable mode 27 30 l2 pb5/a13/ tiocb4 pb5/a13/ tiocb4 pb5/a13/ tiocb4 pb5/ tiocb4 a13 28 31 h4 pb6/a14/ tioca5 pb6/a14/ tioca5 pb6/a14/ tioca5 pb6/ tioca5 a14 29 32 k3 pb7/a15/ tiocb5 pb7/a15/ tiocb5 pb7/a15/ tiocb5 pb7/ tiocb5 a15 30 33 l3 pa0/a16 pa0/a16 pa0/a16 pa0 a16 31 34 j4 pa1/a17/ txd2 pa1/a17/ txd2 pa1/a17/ txd2 pa1/txd2 a17 32 35 k4 pa2/a18/ rxd2 pa2/a18/ rxd2 pa2/a18/ rxd2 pa2/ rxd2 a18 33 36 l4 pa3/a19/ sck2 pa3/a19/ sck2 pa3/a19/ sck2 pa3/ sck2 nc 34 37 h5 p10/ tioca0/ a20 p10/ tioca0/ a20 p10/ tioca0/ a20 p10/ tioca0 nc 35 38 j5 p11/ tiocb0/ a21 p11/ tiocb0/ a21 p11/ tiocb0/ a21 p11/ tiocb0 nc 36 39 l5 p12/ tiocc0/ tclka/a22 p12/ tiocc0/ tclka/a22 p12/ tiocc0/ tclka/a22 p12/ tiocc0/ tclka nc 37 40 k5 p13/ tiocd0/ tclkb/a23 p13/ tiocd0/ tclkb/a23 p13/ tiocd0/ tclkb/a23 p13/ tiocd0/ tclkb nc 38 41 j6 p14/ tioca1/ irq0 p14/ tioca1/ irq0 p14/ tioca1/ irq0 p14/ tioca1/ irq0 vss 39 42 l6 p15/ tiocb1/ tclkc p15/ tiocb1/ tclkc p15/ tiocb1/ tclkc p15/ tiocb1/ tclkc nc 40 43 k6 p16/ tioca2/ irq1 p16/ tioca2/ irq1 p16/ tioca2/ irq1 p16/ tioca2/ irq1 vss 41 44 h6 p17/ tiocb2/ tclkd p17/ tiocb2/ tclkd p17/ tiocb2/ tclkd p17/ tiocb2/ tclkd nc
section 1 overview rev. 5.00 aug 08, 2006 page 31 of 982 rej09b0054-0500 pin no. pin name tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b fp-100bv fp-100a * 1 fp-100av * 1 bp-112 * 2 bp-112v * 2 tbp-112a * 2 tbp- 112av * 2 mode 4 mode 5 mode 6 mode 7 flash memory programmable mode 42 45 k7, l7 avss avss avss avss vss 43 46 j7 p97/da1 p97/da1 p97/da1 p97/da1 nc 44 47 l8 p96/da0 p96/da0 p96/da0 p96/da0 nc 45 48 h7 p47/an7 p47/an7 p47/an7 p47/an7 nc 46 49 k8 p46/an6 p46/an6 p46/an6 p46/an6 nc 47 50 l9 p45/an5 p45/an5 p45/an5 p45/an5 nc 48 51 j8 p44/an4 p44/an4 p44/an4 p44/an4 nc 49 52 k9 p43/an3 p43/an3 p43/an3 p43/an3 nc 50 53 l10 p42/an2 p42/an2 p42/an2 p42/an2 nc 51 54 k10 p41/an1 p41/an1 p41/an1 p41/an1 nc 52 55 k11 p40/an0 p40/an0 p40/an0 p40/an0 nc 53 56 h8 vref vref vref vref vcc 54 57 j10 avcc avcc avcc avcc vcc 55 58 j11 md0 md0 md0 md0 vss 56 59 h9 md1 md1 md1 md1 vss 57 60 h10 osc2 osc2 osc2 osc2 nc 58 61 h11 osc1 osc1 osc1 osc1 vss 59 62 g8 res res res res res 60 63 g9 nmi nmi nmi nmi vcc 61 64 g11 stby stby stby stby vcc 62 65 f9, g10 vcc vcc vcc vcc vcc 63 66 f11 xtal xtal xtal xtal xtal 64 67 f8, f10 vss vss vss vss vss 65 68 e11 extal extal extal extal extal 66 69 e10 fwe fwe fwe fwe fwe 67 70 e9 md2 md2 md2 md2 vss 68 71 d11 pf7/ pf7/ pf7/ pf7/ nc 69 72 e8 as as as pf6 nc 70 73 d10 rd rd rd pf5 nc 71 74 c11 hwr hwr hwr pf4 nc
section 1 overview rev. 5.00 aug 08, 2006 page 32 of 982 rej09b0054-0500 pin no. pin name tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b fp-100bv fp-100a * 1 fp-100av * 1 bp-112 * 2 bp-112v * 2 tbp-112a * 2 tbp- 112av * 2 mode 4 mode 5 mode 6 mode 7 flash memory programmable mode 72 75 d9 pf3/ lwr / adtrg / irq3 pf3/ lwr / adtrg / irq3 pf3/ lwr / adtrg / irq3 pf3/ adtrg / irq3 nc * 3 73 76 c10 pf2/ wait pf2/ wait pf2/ wait pf2 nc 74 77 b11 pf1/ back / buzz pf1/ back / buzz pf1/ back / buzz pf1/ buzz nc 75 78 c9 pf0/ breq / irq2 pf0/ breq / irq2 pf0/ breq / irq2 pf0/ irq2 vcc 76 79 a10 p30/ txd0 p30/ txd0 p30/ txd0 p30/ txd0 nc 77 80 d8 p31/ rxd0 p31/ rxd0 p31/ rxd0 p31/ rxd0 nc 78 81 b9 p32/ sck0/ sda1/ irq4 p32/ sck0/ sda1/ irq4 p32/ sck0/ sda1/ irq4 p32/ sck0/ sda1/ irq4 nc 79 82 a9 p33/ txd1/ scl1 p33/ txd1/ scl1 p33/ txd1/ scl1 p33/ txd1/ scl1 nc 80 83 c8 p34/ rxd1/ sda0 p34/ rxd1/ sda0 p34/ rxd1/ sda0 p34/ rxd1/ sda0 nc 81 84 b8 p35/ sck1/ scl0/ irq5 p35/ sck1/ scl0/ irq5 p35/ sck1/ scl0/ irq5 p35/ sck1/ scl0/ irq5 nc 82 85 a8 p36 p36 p36 p36 nc 83 86 d7 p77/ txd3 p77/ txd3 p77/ txd3 p77/ txd3 nc 84 87 c7 p76/ rxd3 p76/ rxd3 p76/ rxd3 p76/ rxd3 nc
section 1 overview rev. 5.00 aug 08, 2006 page 33 of 982 rej09b0054-0500 pin no. pin name tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b fp-100bv fp-100a * 1 fp-100av * 1 bp-112 * 2 bp-112v * 2 tbp-112a * 2 tbp- 112av * 2 mode 4 mode 5 mode 6 mode 7 flash memory programmable mode 85 88 a7 p75/ tmo3/ sck3 p75/ tmo3/ sck3 p75/ tmo3/ sck3 p75/ tmo3/ sck3 nc 86 89 b7 p74/ tmo2/ mres p74/ tmo2/ mres p74/ tmo2/ mres p74/ tmo2/ mres nc 87 90 c6 p73/ tmo1/ cs7 p73/ tmo1/ cs7 p73/ tmo1/ cs7 p73/ tmo1 nc 88 91 a6 p72/ tmo0/ cs6 p72/ tmo0/ cs6 p72/ tmo0/ cs6 p72/ tmo0 nc 89 92 b6 p71/ tmri23/ tmci23/ cs5 p71/ tmri23/ tmci23/ cs5 p71/ tmri23/ tmci23/ cs5 p71/ tmri23/ tmci23 nc 90 93 d6 p70/ tmri01/ tmci01/ cs4 p70/ tmri01/ tmci01/ cs4 p70/ tmri01/ tmci01/ cs4 p70/ tmri01/ tmci01 nc 91 94 a5 pg0/ irq6 pg0/ irq6 pg0/ irq6 pg0/ irq6 nc 92 95 b5 pg1/ cs3 / irq7 pg1/ cs3 / irq7 pg1/ cs3 / irq7 pg1/ irq7 nc 93 96 c5 pg2/ cs2 pg2/ cs2 pg2/ cs2 pg2 nc 94 97 a4 pg3/ cs1 pg3/ cs1 pg3/ cs1 pg3 nc 95 98 d5 pg4/ cs0 pg4/ cs0 pg4/ cs0 pg4 nc 96 99 b4 pe0/d0 pe0/d0 pe0/d0 pe0 nc 97 100 a3 pe1/d1 pe1/d1 pe1/d1 pe1 nc 98 1 c4 pe2/d2 pe2/d2 pe2/d2 pe2 nc 99 2 b3 pe3/d3 pe3/d3 pe3/d3 pe3 vcc 100 3 a2 pe4/d4 pe4/d4 pe4/d4 pe4 vss notes: 1. supported only by the h8s/2238b and h8s/2236b. 2. supported only by the hd64f2238r. 3. vcc in the h8s/2238b and h8s/2236b.
section 1 overview rev. 5.00 aug 08, 2006 page 34 of 982 rej09b0054-0500 table 1.4 pin arrangements in each mode of h8s/2237 group pin no. pin name tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b fp-100bv fp-100a fp-100av mode 4 mode 5 mode 6 mode 7 prom mode 1 4 pe5/d5 pe5/d5 pe5/d5 pe5 nc 2 5 pe6/d6 pe6/d6 pe6/d6 pe6 nc 3 6 pe7/d7 pe7/d7 pe7/d7 pe7 nc 4 7 d8 d8 d8 pd0 d0 5 8 d9 d9 d9 pd1 d1 6 9 d10 d10 d10 pd2 d2 7 10 d11 d11 d11 pd3 d3 8 11 d12 d12 d12 pd4 d4 9 12 d13 d13 d13 pd5 d5 10 13 d14 d14 d14 pd6 d6 11 14 d15 d15 d15 pd7 d7 12 15 vcc vcc vcc vcc vcc 13 16 a0 a0 pc0/a0 pc0 a0 14 17 vss vss vss vss vss 15 18 a1 a1 pc1/a1 pc1 a1 16 19 a2 a2 pc2/a2 pc2 a2 17 20 a3 a3 pc3/a3 pc3 a3 18 21 a4 a4 pc4/a4 pc4 a4 19 22 a5 a5 pc5/a5 pc5 a5 20 23 a6 a6 pc6/a6 pc6 a6 21 24 a7 a7 pc7/a7 pc7 a7 22 25 pb0/a8/ tioca3 pb0/a8/ tioca3 pb0/a8/ tioca3 pb0/ tioca3 a8 23 26 pb1/a9/ tiocb3 pb1/a9/ tiocb3 pb1/a9/ tiocb3 pb1/ tiocb3 oe 24 27 pb2/a10/ tiocc3 pb2/a10/ tiocc3 pb2/a10/ tiocc3 pb2/ tiocc3 a10
section 1 overview rev. 5.00 aug 08, 2006 page 35 of 982 rej09b0054-0500 pin no. pin name tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b fp-100bv fp-100a fp-100av mode 4 mode 5 mode 6 mode 7 prom mode 25 28 pb3/a11/ tiocd3 pb3/a11/ tiocd3 pb3/a11/ tiocd3 pb3/ tiocd3 a11 26 29 pb4/a12/ tioca4 pb4/a12/ tioca4 pb4/a12/ tioca4 pb4/ tioca4 a12 27 30 pb5/a13/ tiocb4 pb5/a13/ tiocb4 pb5/a13/ tiocb4 pb5/ tiocb4 a13 28 31 pb6/a14/ tioca5 pb6/a14/ tioca5 pb6/a14/ tioca5 pb6/ tioca5 a14 29 32 pb7/a15/ tiocb5 pb7/a15/ tiocb5 pb7/a15/ tiocb5 pb7/ tiocb5 a15 30 33 pa0/a16 pa0/a16 pa0/a16 pa0 a16 31 34 pa1/a17/ txd2 pa1/a17/ txd2 pa1/a17/ txd2 pa1/txd2 vcc 32 35 pa2/a18/ rxd2 pa2/a18/ rxd2 pa2/a18/ rxd2 pa2/rxd2 vcc 33 36 pa3/a19/ sck2 pa3/a19/ sck2 pa3/a19/ sck2 pa3/sck2 nc 34 37 p10/ tioca0/a20 p10/ tioca0/a20 p10/ tioca0/a20 p10/ tioca0 nc 35 38 p11/ tiocb0/a21 p11/ tiocb0/a21 p11/ tiocb0/a21 p11/ tiocb0 nc 36 39 p12/ tiocc0/ tclka/a22 p12/ tiocc0/ tclka/a22 p12/ tiocc0/ tclka/a22 p12/ tiocc0/ tclka nc 37 40 p13/ tiocd0/ tclkb/a23 p13/ tiocd0/ tclkb/a23 p13/ tiocd0/ tclkb/a23 p13/ tiocd0/ tclkb nc 38 41 p14/ tioca1/ irq0 p14/ tioca1/ irq0 p14/ tioca1/ irq0 p14/ tioca1/ irq0 nc 39 42 p15/ tiocb1/ tclkc p15/ tiocb1/ tclkc p15/ tiocb1/ tclkc p15/ tiocb1/ tclkc nc
section 1 overview rev. 5.00 aug 08, 2006 page 36 of 982 rej09b0054-0500 pin no. pin name tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b fp-100bv fp-100a fp-100av mode 4 mode 5 mode 6 mode 7 prom mode 40 43 p16/ tioca2/ irq1 p16/ tioca2/ irq1 p16/ tioca2/ irq1 p16/ tioca2/ irq1 nc 41 44 p17/ tiocb2/ tclkd p17/ tiocb2/ tclkd p17/ tiocb2/ tclkd p17/ tiocb2/ tclkd nc 42 45 avss avss avss avss vss 43 46 p97/da1 p97/da1 p97/da1 p97/da1 nc 44 47 p96/da0 p96/da0 p96/da0 p96/da0 nc 45 48 p47/an7 p47/an7 p47/an7 p47/an7 nc 46 49 p46/an6 p46/an6 p46/an6 p46/an6 nc 47 50 p45/an5 p45/an5 p45/an5 p45/an5 nc 48 51 p44/an4 p44/an4 p44/an4 p44/an4 nc 49 52 p43/an3 p43/an3 p43/an3 p43/an3 nc 50 53 p42/an2 p42/an2 p42/an2 p42/an2 nc 51 54 p41/an1 p41/an1 p41/an1 p41/an1 nc 52 55 p40/an0 p40/an0 p40/an0 p40/an0 nc 53 56 vref vref vref vref vcc 54 57 avcc avcc avcc avcc vcc 55 58 md0 md0 md0 md0 vss 56 59 md1 md1 md1 md1 vss 57 60 osc2 osc2 osc2 osc2 nc 58 61 osc1 osc1 osc1 osc1 nc 59 62 res res res res vpp 60 63 nmi nmi nmi nmi a9 61 64 stby stby stby stby vss 62 65 vcc vcc vcc vcc vcc 63 66 xtal xtal xtal xtal nc 64 67 vss vss vss vss vss 65 68 extal extal extal extal nc
section 1 overview rev. 5.00 aug 08, 2006 page 37 of 982 rej09b0054-0500 pin no. pin name tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b fp-100bv fp-100a fp-100av mode 4 mode 5 mode 6 mode 7 prom mode 66 69 fwe fwe fwe fwe nc 67 70 md2 md2 md2 md2 vss 68 71 pf7/ pf7/ pf7/ pf7/ nc 69 72 as as as pf6 nc 70 73 rd rd rd pf5 nc 71 74 hwr hwr hwr pf4 nc 72 75 pf3/ lwr / adtrg / irq3 pf3/ lwr / adtrg / irq3 pf3/ lwr / adtrg / irq3 pf3/ adtrg / irq3 nc 73 76 pf2/ wait pf2/ wait pf2/ wait pf2 ce 74 77 pf1/ back / buzz pf1/ back / buzz pf1/ back / buzz pf1/buzz pgm 75 78 pf0/ breq / irq2 pf0/ breq / irq2 pf0/ breq / irq2 pf0/ irq2 nc 76 79 p30/txd0 p30/txd0 p30/txd0 p30/txd0 nc 77 80 p31/rxd0 p31/rxd0 p31/rxd0 p31/rxd0 nc 78 81 p32/sck0/ irq4 p32/sck0/ irq4 p32/sck0/ irq4 p32/sck0/ irq4 nc 79 82 p33/txd1 p33/txd1 p33/txd1 p33/txd1 nc 80 83 p34/rxd1 p34/rxd1 p34/rxd1 p34/rxd1 nc 81 84 p35/sck1/ irq5 p35/sck1/ irq5 p35/sck1/ irq5 p35/sck1/ irq5 nc 82 85 p36 p36 p36 p36 nc 83 86 p77/txd3 p77/txd3 p77/txd3 p77/txd3 nc 84 87 p76/rxd3 p76/rxd3 p76/rxd3 p76/rxd3 nc 85 88 p75/sck3 p75/sck3 p75/sck3 p75/sck3 nc 86 89 p74/ mres p74/ mres p74/ mres p74/ mres nc 87 90 p73/tmo1/ cs7 p73/tmo1/ cs7 p73/tmo1/ cs7 p73/tmo1 nc
section 1 overview rev. 5.00 aug 08, 2006 page 38 of 982 rej09b0054-0500 pin no. pin name tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b fp-100bv fp-100a fp-100av mode 4 mode 5 mode 6 mode 7 prom mode 88 91 p72/tmo0/ cs6 p72/tmo0/ cs6 p72/tmo0/ cs6 p72/tmo0 nc 89 92 p71/ cs5 p71/ cs5 p71/ cs5 p71 nc 90 93 p70/ tmri01/ tmci01/ cs4 p70/ tmri01/ tmci01/ cs4 p70/ tmri01/ tmci01/ cs4 p70/ tmri01/ tmci01 nc 91 94 pg0/ irq6 pg0/ irq6 pg0/ irq6 pg0/ irq6 nc 92 95 pg1/ cs3 / irq7 pg1/ cs3 / irq7 pg1/ cs3 / irq7 pg1/ irq7 nc 93 96 pg2/ cs2 pg2/ cs2 pg2/ cs2 pg2 nc 94 97 pg3/ cs1 pg3/ cs1 pg3/ cs1 pg3 nc 95 98 pg4/ cs0 pg4/ cs0 pg4/ cs0 pg4 nc 96 99 pe0/d0 pe0/d0 pe0/d0 pe0 nc 97 100 pe1/d1 pe1/d1 pe1/d1 pe1 nc 98 1 pe2/d2 pe2/d2 pe2/d2 pe2 nc 99 2 pe3/d3 pe3/d3 pe3/d3 pe3 nc 100 3 pe4/d4 pe4/d4 pe4/d4 pe4 nc
section 1 overview rev. 5.00 aug 08, 2006 page 39 of 982 rej09b0054-0500 table 1.5 pin arrangements in each mode of h8s/2227 group pin no. pin name tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b * 1 fp-100bv * 1 fp-100a * 2 fp-100av * 2 mode 4 mode 5 mode 6 mode 7 flash memory programmable mode 1 4 pe5/d5 pe5/d5 pe5/d5 pe5 oe 2 5 pe6/d6 pe6/d6 pe6/d6 pe6 we 3 6 pe7/d7 pe7/d7 pe7/d7 pe7 ce 4 7 d8 d8 d8 pd0 d0 5 8 d9 d9 d9 pd1 d1 6 9 d10 d10 d10 pd2 d2 7 10 d11 d11 d11 pd3 d3 8 11 d12 d12 d12 pd4 d4 9 12 d13 d13 d13 pd5 d5 10 13 d14 d14 d14 pd6 d6 11 14 d15 d15 d15 pd7 d7 12 15 vcc vcc vcc vcc vcc 13 16 a0 a0 pc0/a0 pc0 a0 14 17 vss vss vss vss vss 15 18 a1 a1 pc1/a1 pc1 a1 16 19 a2 a2 pc2/a2 pc2 a2 17 20 a3 a3 pc3/a3 pc3 a3 18 21 a4 a4 pc4/a4 pc4 a4 19 22 a5 a5 pc5/a5 pc5 a5 20 23 a6 a6 pc6/a6 pc6 a6 21 24 a7 a7 pc7/a7 pc7 a7 22 25 pb0/a8 pb0/a8 pb0/a8 pb0 a8 23 26 pb1/a9 pb1/a9 pb1/a9 pb1 a9 24 27 pb2/a10 pb2/a10 pb2/a10 pb2 a10 25 28 pb3/a11 pb3/a11 pb3/a11 pb3 a11
section 1 overview rev. 5.00 aug 08, 2006 page 40 of 982 rej09b0054-0500 pin no. pin name tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b * 1 fp-100bv * 1 fp-100a * 2 fp-100av * 2 mode 4 mode 5 mode 6 mode 7 flash memory programmable mode 26 29 pb4/a12 pb4/a12 pb4/a12 pb4 a12 27 30 pb5/a13 pb5/a13 pb5/a13 pb5 a13 28 31 pb6/a14 pb6/a14 pb6/a14 pb6 a14 29 32 pb7/a15 pb7/a15 pb7/a15 pb7 a15 30 33 pa0/a16 pa0/a16 pa0/a16 pa0 a16 31 34 pa1/a17 pa1/a17 pa1/a17 pa1 a17 32 35 pa2/a18 pa2/a18 pa2/a18 pa2 a18 33 36 pa3/a19 pa3/a19 pa3/a19 pa3 nc 34 37 p10/ tioca0/ a20 p10/ tioca0/ a20 p10/ tioca0/ a20 p10/ tioca0 nc 35 38 p11/ tiocb0/ a21 p11/ tiocb0/ a21 p11/ tiocb0/ a21 p11/ tiocb0 nc 36 39 p12/ tiocc0/ tclka/a22 p12/ tiocc0/ tclka/a22 p12/ tiocc0/ tclka/a22 p12/ tiocc0/ tclka nc 37 40 p13/ tiocd0/ tclkb/a23 p13/ tiocd0/ tclkb/a23 p13/ tiocd0/ tclkb/a23 p13/ tiocd0/ tclkb nc 38 41 p14/ tioca1/ irq0 p14/ tioca1/ irq0 p14/ tioca1/ irq0 p14/ tioca1/ irq0 vss 39 42 p15/ tiocb1/ tclkc p15/ tiocb1/ tclkc p15/ tiocb1/ tclkc p15/ tiocb1/ tclkc nc 40 43 p16/ tioca2/ irq1 p16/ tioca2/ irq1 p16/ tioca2/ irq1 p16/ tioca2/ irq1 vss 41 44 p17/ tiocb2/ tclkd p17/ tiocb2/ tclkd p17/ tiocb2/ tclkd p17/ tiocb2/ tclkd nc 42 45 avss avss avss avss vss
section 1 overview rev. 5.00 aug 08, 2006 page 41 of 982 rej09b0054-0500 pin no. pin name tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b * 1 fp-100bv * 1 fp-100a * 2 fp-100av * 2 mode 4 mode 5 mode 6 mode 7 flash memory programmable mode 43 46 p97 p97 p97 p97 nc 44 47 p96 p96 p96 p96 nc 45 48 p47/an7 p47/an7 p47/an7 p47/an7 nc 46 49 p46/an6 p46/an6 p46/an6 p46/an6 nc 47 50 p45/an5 p45/an5 p45/an5 p45/an5 nc 48 51 p44/an4 p44/an4 p44/an4 p44/an4 nc 49 52 p43/an3 p43/an3 p43/an3 p43/an3 nc 50 53 p42/an2 p42/an2 p42/an2 p42/an2 nc 51 54 p41/an1 p41/an1 p41/an1 p41/an1 nc 52 55 p40/an0 p40/an0 p40/an0 p40/an0 nc 53 56 vref vref vref vref vcc 54 57 avcc avcc avcc avcc vcc 55 58 md0 md0 md0 md0 vss 56 59 md1 md1 md1 md1 vss 57 60 osc2 osc2 osc2 osc2 nc 58 61 osc1 osc1 osc1 osc1 vss 59 62 res res res res res 60 63 nmi nmi nmi nmi vcc 61 64 stby stby stby stby vcc 62 65 vcc vcc vcc vcc vcc 63 66 xtal xtal xtal xtal xtal 64 67 vss vss vss vss vss 65 68 extal extal extal extal extal 66 69 fwe fwe fwe fwe fwe 67 70 md2 md2 md2 md2 vss 68 71 pf7/ pf7/ pf7/ pf7/ nc 69 72 as as as pf6 nc 70 73 rd rd rd pf5 nc
section 1 overview rev. 5.00 aug 08, 2006 page 42 of 982 rej09b0054-0500 pin no. pin name tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b * 1 fp-100bv * 1 fp-100a * 2 fp-100av * 2 mode 4 mode 5 mode 6 mode 7 flash memory programmable mode 71 74 hwr hwr hwr pf4 nc 72 75 pf3/ lwr / adtrg / irq3 pf3/ lwr / adtrg / irq3 pf3/ lwr / adtrg / irq3 pf3/ adtrg / irq3 vcc 73 76 pf2/ wait pf2/ wait pf2/ wait pf2 nc 74 77 pf1/ back / buzz pf1/ back / buzz pf1/ back / buzz pf1/buzz nc 75 78 pf0/ breq / irq2 pf0/ breq / irq2 pf0/ breq / irq2 pf0/ irq2 vcc 76 79 p30/txd0 p30/txd0 p30/txd0 p30/txd0 nc 77 80 p31/rxd0 p31/rxd0 p31/rxd0 p31/rxd0 nc 78 81 p32/sck0/ irq4 p32/sck0/ irq4 p32/sck0/ irq4 p32/sck0/ irq4 nc 79 82 p33/txd1 p33/txd1 p33/txd1 p33/txd1 nc 80 83 p34/rxd1 p34/rxd1 p34/rxd1 p34/rxd1 nc 81 84 p35/sck1/ irq5 p35/sck1/ irq5 p35/sck1/ irq5 p35/sck1/ irq5 nc 82 85 p36 p36 p36 p36 nc 83 86 p77/txd3 p77/txd3 p77/txd3 p77/txd3 nc 84 87 p76/rxd3 p76/rxd3 p76/rxd3 p76/rxd3 nc 85 88 p75/sck3 p75/sck3 p75/sck3 p75/sck3 nc 86 89 p74/ mres p74/ mres p74/ mres p74/ mres nc 87 90 p73/tmo1/ cs7 p73/tmo1/ cs7 p73/tmo1/ cs7 p73/tmo1 nc 88 91 p72/tmo0/ cs6 p72/tmo0/ cs6 p72/tmo0/ cs6 p72/tmo0 nc 89 92 p71/ cs5 p71/ cs5 p71/ cs5 p71 nc 90 93 p70/ tmri01/ tmci01/ cs4 p70/ tmri01/ tmci01/ cs4 p70/ tmri01/ tmci01/ cs4 p70/ tmri01/ tmci01 nc 91 94 pg0/ irq6 pg0/ irq6 pg0/ irq6 pg0/ irq6 nc
section 1 overview rev. 5.00 aug 08, 2006 page 43 of 982 rej09b0054-0500 pin no. pin name tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b * 1 fp-100bv * 1 fp-100a * 2 fp-100av * 2 mode 4 mode 5 mode 6 mode 7 flash memory programmable mode 92 95 pg1/ cs3 / irq7 pg1/ cs3 / irq7 pg1/ cs3 / irq7 pg1/ irq7 nc 93 96 pg2/ cs2 pg2/ cs2 pg2/ cs2 pg2 nc 94 97 pg3/ cs1 pg3/ cs1 pg3/ cs1 pg3 nc 95 98 pg4/ cs0 pg4/ cs0 pg4/ cs0 pg4 nc 96 99 pe0/d0 pe0/d0 pe0/d0 pe0 nc 97 100 pe1/d1 pe1/d1 pe1/d1 pe1 nc 98 1 pe2/d2 pe2/d2 pe2/d2 pe2 nc 99 2 pe3/d3 pe3/d3 pe3/d3 pe3 vcc 100 3 pe4/d4 pe4/d4 pe4/d4 pe4 vss notes: 1. supported only by masked rom version. 2. supported only by the hd6432227.
section 1 overview rev. 5.00 aug 08, 2006 page 44 of 982 rej09b0054-0500 1.3.3 pin functions table 1.6 lists the pin functions of the h8s/2258 group. table 1.7 lists the pin functions of the h8s/2239 group and h8s/2238 group. table 1.8 lists the pin functions of the h8s/2237 group and h8s/2227 group. table 1.6 pin functions of h8s/2258 group pin no. type symbol tfp-100b tfp-100bv fp-100b fp-100bv fp-100a fp-100av i/o function power supply vcc 62 65 input for connection to the power supply. connect all v cc pins to the system power supply. cvcc 12 15 input connect a 0.1-f stabilization capacitance between this pin and ground. permanent damage on the chip may result if the absolute maximum rating of cv cc 4.3 v is exceeded. must not connect the 5 v external power supply to this pin. see section 25, power supply circuit, for connection examples. vss 14 64 17 67 input for connection to the power supply (0 v). connect all vss pins to the system power supply (0 v). clock xtal 63 66 input for connection to a crystal resonator. for examples of crystal resonator connection and external clock input, see section 23, clock pulse generator. extal 65 68 input for connection to a crystal resonator. this pin can be also used for external clock input. for examples of crystal resonator connection and external clock input, see section 23, clock pulse generator. osc1 58 61 input connects to a 32.768 khz crystal resonator. see section 23, clock pulse generator, for typical connection diagrams for a crystal resonator.
section 1 overview rev. 5.00 aug 08, 2006 page 45 of 982 rej09b0054-0500 pin no. type symbol tfp-100b tfp-100bv fp-100b fp-100bv fp-100a fp-100av i/o function clock osc2 57 60 input connects to a 32.768 khz crystal resonator. see section 23, clock pulse generator, for typical connection diagrams for a crystal resonator. 68 71 output supplies the system clock to external devices. operating mode control md2 md1 md0 67 56 55 70 59 58 input sets the operating mode. inputs at these pins should not be changed during operation. except for mode changing, be sure to fix the levels of the mode pins (md2 to md0) by pulling them down or pulling them up until the power turns off. system control res * 59 62 input reset input pin. when this pin is low, the chip enters the power-on reset state. mres 86 89 input when this pin is low, the chip enters the manual reset state. stby * 61 64 input when this pin is low, a transition is made to hardware standby mode. breq 75 78 input used by an external bus master to request the bus mastership to this lsi. back 74 77 output indicates that the bus mastership has been granted to an external bus master. fwe 66 69 input enables/disables programming the flash memory. interrupts nmi * 60 63 input nonmaskable interrupt pin. if this pin is not used, it should be fixed high. irq7 irq6 irq5 irq4 irq3 irq2 irq1 irq0 92 91 81 78 72 75 40 38 95 94 84 81 75 78 43 41 input these pins request a maskable interrupt. address bus a23 to a0 37 to 15, 13 40 to 18, 16 output outputs address.
section 1 overview rev. 5.00 aug 08, 2006 page 46 of 982 rej09b0054-0500 pin no. type symbol tfp-100b tfp-100bv fp-100b fp-100bv fp-100a fp-100av i/o function data bus d15 to d0 100 to 96, 11 to 1 100, 99, 14 to 1 input/ output used as the bidirectional data bus. bus control cs7 cs6 cs5 cs4 cs3 cs2 cs1 cs0 87 88 89 90 92 93 94 95 90 91 92 93 95 96 97 98 output select signals for areas 7 to 0. as 69 72 output when this pin is low, it indicates valid address output on the address bus. rd 70 73 output when this pin is low, it indicates that the external address space is being read. hwr 71 74 output strobe signal: writes to the external address bus to indicate valid data on the upper data bus (d15 to d8). lwr 72 75 output strobe signal: writes to the external bus to indicate valid data on the lower data bus (d7 to d0). wait 73 76 input requests insertion of wait states in bus cycle when accesses to the external three- state address. 16-bit timer- pulse unit (tpu) tclkd tclkc tclkb tclka 41 39 37 36 44 42 40 39 input these pins input an external clock. tioca0 tiocb0 tiocc0 tiocd0 34 35 36 37 37 38 39 40 input/ output pins for the tgra_0 to tgrd_0 input capture input, output compare output, or pwm output. tioca1 tiocb1 38 39 41 42 input/ output pins for the tgra _ 1 and tgrb _ 1 input capture input, output compare output, or pwm output. tioca2 tiocb2 40 41 43 44 input/ output pins for the tgra _ 2 and tgrb _ 2 input capture input, output compare output, or pwm output.
section 1 overview rev. 5.00 aug 08, 2006 page 47 of 982 rej09b0054-0500 pin no. type symbol tfp-100b tfp-100bv fp-100b fp-100bv fp-100a fp-100av i/o function 16-bit timer- pulse unit (tpu) tioca3 tiocb3 tiocc3 tiocd3 22 23 24 25 25 26 27 28 input/ output pins for the tgra_3 to tgrd_3 input capture input, output compare output, or pwm output. tioca4 tiocb4 26 27 29 30 input/ output pins for the tgra_4 and tgrb_4 input capture input, output compare output, or pwm output. tioca5 tiocb5 28 29 31 32 input/ output pins for the tgra_5 and tgrb_5 input capture input, output compare output, or pwm output. 8-bit timer tmo3 to tmo0 88 to 85 91 to 88 output compare-match output pins. tmci23 tmci01 89 90 92 93 input pins for external clock input to the counter. tmri23 tmri01 89 90 92 93 input counter reset input pins. watchdog timer (wdt) buzz 74 77 output this pin outputs the pulse that is divided by watchdog timer. txd3 txd2 txd1 txd0 83 31 79 76 86 34 82 79 output data output pins. serial communi- cation interface (sci)/ smart card interface rxd3 rxd2 rxd1 rxd0 84 32 80 77 87 35 83 80 input data input pins. sck3 sck2 sck1 sck0 85 33 81 78 88 36 84 81 input/ output clock input/output pins. sck1 outputs nmos push/pull. scl1 scl0 79 81 82 84 input/ output i 2 c clock input/output pins. these pins drive bus. the output of scl0 is nmos open drain. i 2 c bus interface (iic) (optional) sda1 sda0 78 80 81 83 input/ output i 2 c data input/output pins. these pins drive bus. the output of sda0 is nmos open drain.
section 1 overview rev. 5.00 aug 08, 2006 page 48 of 982 rej09b0054-0500 pin no. type symbol tfp-100b tfp-100bv fp-100b fp-100bv fp-100a fp-100av i/o function tx 93 96 output ieb transmit data output pin. iebus controller (ieb) rx 94 97 input ieb receive data input pin a/d converter an7 to an0 52 to 45 55 to 48 input analog input pins for the a/d converter. adtrg 72 75 input pin for input of an external trigger to start a/d conversion. d/a converter da1 da0 43 44 46 47 output analog output pins for the d/a converter. a/d converter, d/a converter avcc 54 57 input power supply pin for the a/d converter and d/a converter. if none of the a/d converter and d/a converter is used, connect this pin to the system power supply (+5 v). avss 42 45 input ground pin for the a/d converter and d/a converter. connect this pin to the system power supply (0 v). vref 53 56 input reference voltage input pin for the a/d converter and d/a converter. if neither the a/d converter nor d/a converter is used, connect this pin to the system power supply (+5 v). i/o ports p17 to p10 41 to 34 44 to 37 input/ output 8-bit i/o pins. p36 to p30 82 to 76 85 to 79 input/ output 7-bit i/o pins. p34 and p35 output nmos push/pull. p47 to p40 52 to 45 55 to 48 input 8-bit input pins. p77 to p70 90 to 83 93 to 86 input/ output 8-bit i/o pins. p97 p96 43 44 46 47 input 2-bit input pins. pa3 to pa0 33 to 30 36 to 33 input/ output 4-bit i/o pins. pb7 to pb0 29 to 22 32 to 25 input/ output 8-bit i/o pins.
section 1 overview rev. 5.00 aug 08, 2006 page 49 of 982 rej09b0054-0500 pin no. type symbol tfp-100b tfp-100bv fp-100b fp-100bv fp-100a fp-100av i/o function i/o ports pc7 to pc0 21 to 15, 13 24 to 18, 16 input/ output 8-bit i/o pins. pd7 to pd0 11 to 4 14 to 7 input/ output 8-bit i/o pins. pe7 to pe0 100 to 96, 3 to 1 100, 99, 6 to 1 input/ output 8-bit i/o pins. pf7 to pf0 75 to 68 78 to 71 input/ output 8-bit i/o pins. pg4 to pg0 95 to 91 98 to 94 input/ output 5-bit i/o pins. note: * measures should be taken to deal with noise, which can cause operation errors otherwise.
section 1 overview rev. 5.00 aug 08, 2006 page 50 of 982 rej09b0054-0500 table 1.7 pin functions of h8s/2239 group and h8s/2238 group pin no. type symbol tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b fp-100bv fp-100a * 3 fp-100av * 3 bp-112 * 1 bp-112v * 1 tbp-112a * 4 tbp-112av * 4 i/o function power supply vcc 62 65 f9, g10 input for connection to the power supply. connect all v cc pins to the system power supply. cvcc 12 15 e2, f3 input with a 5-v external power supply (h8s/2238b used), connect a 0.1-f stabilization capacitance between this pin and ground. permanent damage on the chip may result if the absolute maximum rating of cv cc 4.3 v is exceeded. must not connect the 5 v external power supply to this pin. with a 3-v external power supply (h8s/2239, h8s/2238r, and h8s/2236r used), connect this pin to the system power supply. see section 25, power supply circuit, for connection examples. vss 14 64 17 67 f3, f2 f10, f8 input for connection to the power supply (0 v). connect all vss pins to the system power supply (0 v). clock xtal 63 66 f11 input for connection to a crystal resonator. for examples of crystal resonator connection and external clock input, see section 23, clock pulse generator. extal 65 68 e11 input for connection to a crystal resonator. this pin can be also used for external clock input. for examples of crystal resonator connection and external clock input, see section 23, clock pulse generator. osc1 58 61 h11 input connects to a 32.768 khz crystal resonator. see section 23, clock pulse generator, for typical connection diagrams for a crystal resonator.
section 1 overview rev. 5.00 aug 08, 2006 page 51 of 982 rej09b0054-0500 pin no. type symbol tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b fp-100bv fp-100a * 3 fp-100av * 3 bp-112 * 1 bp-112v * 1 tbp-112a * 4 tbp-112av * 4 i/o function clock osc2 57 60 h10 input connects to a 32.768 khz crystal resonator. see section 23, clock pulse generator, for typical connection diagrams for a crystal resonator. 68 71 d11 output supplies the system clock to external devices. operating mode control md2 md1 md0 67 56 55 70 59 58 e9 h9 j11 input sets the operating mode. inputs at these pins should not be changed during operation. except for mode changing, be sure to fix the levels of the mode pins (md2 to md0) by pulling them down or pulling them up until the power turns off. system control res * 5 59 62 g8 input reset input pin. when this pin is low, the chip enters the power-on reset state. mres 86 89 b7 input when this pin is low, the chip enters the manual reset state. stby * 5 61 64 g11 input when this pin is low, a transition is made to hardware standby mode. breq 75 78 c9 input used by an external bus master to request the bus mastership to this lsi. back 74 77 b11 output indicates that the bus mastership has been granted to an external bus master. fwe 66 69 e10 input enables/disables programming the flash memory. interrupts nmi * 5 60 63 g9 input nonmaskable interrupt pin. if this pin is not used, it should be fixed high. irq7 irq6 irq5 irq4 irq3 irq2 irq1 irq0 92 91 81 78 72 75 40 38 95 94 84 81 75 78 43 41 b5 a5 b8 b9 d9 c9 k6 j6 input these pins request a maskable interrupt.
section 1 overview rev. 5.00 aug 08, 2006 page 52 of 982 rej09b0054-0500 pin no. type symbol tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b fp-100bv fp-100a * 3 fp-100av * 3 bp-112 * 1 bp-112v * 1 tbp-112a * 4 tbp-112av * 4 i/o function address bus a23 to a0 37 to 15, 13 40 to 18, 16 l5, l4, l3, l2, k5, k4, k3, k2, k1, j5, j4, j3, j2, j1, h5, h4, h3, h2, h1, g4, g3, g2, g1, f1 output outputs address. data bus d15 to d0 100 to 96, 11 to 1 100, 99, 14 to 1 e4, e3, e1, d4, d3, d2, d1, c4, c2, c1, b4, b3, b2, b1, a3, a2 input/ output used as the bidirectional data bus. bus control cs7 cs6 cs5 cs4 cs3 cs2 cs1 cs0 87 88 89 90 92 93 94 95 90 91 92 93 95 96 97 98 c6 a6 b6 d6 b5 c5 a4 d5 output select signals for areas 7 to 0. as 69 72 e8 output when this pin is low, it indicates valid address output on the address bus. rd 70 73 d10 output when this pin is low, it indicates that the external address space is being read. hwr 71 74 c11 output strobe signal: writes to the external address bus to indicate valid data on the upper data bus (d15 to d8). lwr 72 75 d9 output strobe signal: writes to the external bus to indicate valid data on the lower data bus (d7 to d0). wait 73 76 c10 input requests insertion of wait states in bus cycle when accesses to the external three- state address.
section 1 overview rev. 5.00 aug 08, 2006 page 53 of 982 rej09b0054-0500 pin no. type symbol tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b fp-100bv fp-100a * 3 fp-100av * 3 bp-112 * 1 bp-112v * 1 tbp-112a * 4 tbp-112av * 4 i/o function dma controller (dmac) * 2 dreq1 dreq0 89 90 ? b6 d6 input request dmac activation. (supported only by the h8s/2239 group.) tend1 tend0 87 88 ? c6 a6 output indicate that the dmac has ended transmitting data. (supported only by the h8s/2239 group.) dack1 dack0 35 34 ? j5 h5 output these pins function as single address transmitting acknowledge of dmac. (supported only by the h8s/2239 group.) 16-bit timer- pulse unit (tpu) tclkd tclkc tclkb tclka 41 39 37 36 44 42 40 39 h6 l6 k5 l5 input these pins input an external clock. tioca0 tiocb0 tiocc0 tiocd0 34 35 36 37 37 38 39 40 h5 j5 l5 k5 input/ output pins for the tgra_0 to tgrd_0 input capture input, output compare output, or pwm output. tioca1 tiocb1 38 39 41 42 j6 l6 input/ output pins for the tgra _ 1 and tgrb _ 1 input capture input, output compare output, or pwm output. tioca2 tiocb2 40 41 43 44 k6 h6 input/ output pins for the tgra _ 2 and tgrb _ 2 input capture input, output compare output, or pwm output. tioca3 tiocb3 tiocc3 tiocd3 22 23 24 25 25 26 27 28 h3 j2 k1 j3 input/ output pins for the tgra_3 to tgrd_3 input capture input, output compare output, or pwm output. tioca4 tiocb4 26 27 29 30 k2 l2 input/ output pins for the tgra_4 and tgrb_4 input capture input, output compare output, or pwm output. tioca5 tiocb5 28 29 31 32 h4 k3 input/ output pins for the tgra_5 and tgrb_5 input capture input, output compare output, or pwm output.
section 1 overview rev. 5.00 aug 08, 2006 page 54 of 982 rej09b0054-0500 pin no. type symbol tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b fp-100bv fp-100a * 3 fp-100av * 3 bp-112 * 1 bp-112v * 1 tbp-112a * 4 tbp-112av * 4 i/o function 8-bit timer tmo3 to tmo0 88 to 85 91 to 88 a7, a6, b7, c6 output compare-match output pins. tmci23 tmci01 89 90 92 93 b6 d6 input pins for external clock input to the counter. tmri23 tmri01 89 90 92 93 b6 d6 input counter reset input pins. watchdog timer (wdt) buzz 74 77 b11 output this pin outputs the pulse that is divided by watchdog timer. txd3 txd2 txd1 txd0 83 31 79 76 86 34 82 79 d7 j4 a9 a10 output data output pins. serial communi- cation interface (sci)/ smart card interface rxd3 rxd2 rxd1 rxd0 84 32 80 77 87 35 83 80 c7 k4 c8 d8 input data input pins. sck3 sck2 sck1 sck0 85 33 81 78 88 36 84 81 a7 l4 b8 b9 input/ output clock input/output pins. sck1 outputs nmos push/pull. i 2 c bus interface (iic) (optional) scl1 scl0 79 81 82 84 a9 b8 input/ output i 2 c clock input/output pins. these pins drive bus. the output of scl0 is nmos open drain. sda1 sda0 78 80 81 83 b9 c8 input/ output i 2 c data input/output pins. these pins drive bus. the output of sda0 is nmos open drain. a/d converter an7 to an0 52 to 45 55 to 48 l10, l9, k11, k10, k9, k8, j8, h7 input analog input pins for the a/d converter. adtrg 72 75 d9 input pin for input of an external trigger to start a/d conversion.
section 1 overview rev. 5.00 aug 08, 2006 page 55 of 982 rej09b0054-0500 pin no. type symbol tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b fp-100bv fp-100a * 3 fp-100av * 3 bp-112 * 1 bp-112v * 1 tbp-112a * 4 tbp-112av * 4 i/o function d/a converter da1 da0 43 44 46 47 j7 l8 output analog output pins for the d/a converter. a/d converter, d/a converter avcc 54 57 j10 input power supply pin for the a/d converter and d/a converter. if none of the a/d converter and d/a converter is used, connect this pin to the system power supply (+3 v). avss 42 45 k7, l7 input ground pin for the a/d converter and d/a converter. connect this pin to the system power supply (0 v). vref 53 56 h8 input reference voltage input pin for the a/d converter and d/a converter. if neither the a/d converter nor d/a converter is used, connect this pin to the system power supply (+3 v). i/o ports p17 to p10 41 to 34 44 to 37 l6, l5, k6, k5, j6, j5, h6, h5 input/ output 8-bit i/o pins. p36 to p30 82 to 76 85 to 79 d8, c8, b9, b8, a10, a9, a8 input/ output 7-bit i/o pins. p34 and p35 output nmos push/pull. p47 to p40 52 to 45 55 to 48 l10, l9, k11, k10, k9, k8, h7, j8 input 8-bit input pins. p77 to p70 90 to 83 93 to 86 d7, d6, c7, c6, b7, b6, a7, a6 input/ output 8-bit i/o pins. p97 p96 43 44 46 47 j7 l8 input 2-bit input pins. pa3 to pa0 33 to 30 36 to 33 l4, l3, k3, j4 input/ output 4-bit i/o pins. pb7 to pb0 29 to 22 32 to 25 l2, k3, k2, k1, j3, j2, h4, h3 input/ output 8-bit i/o pins.
section 1 overview rev. 5.00 aug 08, 2006 page 56 of 982 rej09b0054-0500 pin no. type symbol tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b fp-100bv fp-100a * 3 fp-100av * 3 bp-112 * 1 bp-112v * 1 tbp-112a * 4 tbp-112av * 4 i/o function i/o ports pc7 to pc0 21 to 15, 13 24 to 18, 16 j1, h2, h1, g4, g3, g2, g1, f1 input/ output 8-bit i/o pins. pd7 to pd0 11 to 4 14 to 7 e4, e3, e1, d3, d2, d1, c2, c1 input/ output 8-bit i/o pins. pe7 to pe0 100 to 96, 3 to 1 100, 99, 6 to 1 d4, c4, b4, b3, b2, b1, a3, a2 input/ output 8-bit i/o pins. pf7 to pf0 75 to 68 78 to 71 e8, d11, d10, d9, c11, c10, c9, b11 input/ output 8-bit i/o pins. pg4 to pg0 95 to 91 98 to 94 d5, c5, b5, a5, a4 input/ output 5-bit i/o pins. notes: 1. supported only by the hd64f2238r. 2. supported only by the h8s/2239 group. 3. supported only by the h8s/2238b and h8s/2236b. 4. supported only by the hd64f2238r and hd64f2239. 5. measures should be taken to deal with noise, which can cause operation errors otherwise.
section 1 overview rev. 5.00 aug 08, 2006 page 57 of 982 rej09b0054-0500 table 1.8 pin functions of h8s/2237 group and h8s/2227 group pin no. type symbol tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b * 1 fp-100bv * 1 fp-100a * 2 fp-100av * 2 i/o function power supply vcc 12 62 15 65 input for connection to the power supply. connect all vcc pins to the system power supply. vss 14 64 17 67 input for connection to the power supply (0 v). connect all vss pins to the system power supply (0 v). clock xtal 63 66 input for connection to a crystal resonator. for examples of crystal resonator connection and external clock input, see section 23, clock pulse generator. extal 65 68 input for connection to a crystal resonator. this pin can be also used for external clock input. for examples of crystal resonator connection and external clock input, see section 23, clock pulse generator. osc1 58 61 input connects to a 32.768 khz crystal resonator. see section 23, clock pulse generator, for typical connection diagrams for a crystal resonator. osc2 57 60 input connects to a 32.768 khz crystal resonator. see section 23, clock pulse generator, for typical connection diagrams for a crystal resonator. 68 71 output supplies the system clock to external devices. operating mode control md2 md1 md0 67 56 55 70 59 58 input sets the operating mode. inputs at these pins should not be changed during operation. except for mode changing, be sure to fix the levels of the mode pins (md2 to md0) by pulling them down or pulling them up until the power turns off. system control res * 3 59 62 input reset input pin. when this pin is low, the chip enters in the power-on reset state. mres 86 89 input when this pin is low, the chip enters in the manual reset state. stby * 3 61 64 input when this pin is low, a transition is made to hardware standby mode.
section 1 overview rev. 5.00 aug 08, 2006 page 58 of 982 rej09b0054-0500 pin no. type symbol tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b * 1 fp-100bv * 1 fp-100a * 2 fp-100av * 2 i/o function system control breq 75 78 input used by an external bus master to request the bus mastership to this lsi. back 74 77 output indicates that the bus mastership has been granted to an external bus master. few 66 69 input enables/disables programming the flash memory. interrupts nmi * 3 60 63 input nonmaskable interrupt pin. if this pin is not used, it should be fixed-high. irq7 irq6 irq5 irq4 irq3 irq2 irq1 irq0 92 91 81 78 72 75 40 38 95 94 84 81 75 78 43 41 input these pins request a maskable interrupt. address bus a23 to a0 37 to 15, 13 40 to 18, 16 output outputs address. data bus d15 to d0 100 to 96, 11 to 1 100, 99, 14 to 1 input/ output used as the bidirectional data bus. bus control cs7 cs6 cs5 cs4 cs3 cs2 cs1 cs0 87 88 89 90 92 93 94 95 90 91 92 93 95 96 97 98 output select signals for areas 7 to 0. as 69 72 output when this pin is low, it indicates valid address output on the address bus. rd 70 73 output when this pin is low, it indicates that the external address space is being read. hwr 71 74 output strobe signal: writes to the external address bus to indicate valid data on the upper data bus (d15 to d8).
section 1 overview rev. 5.00 aug 08, 2006 page 59 of 982 rej09b0054-0500 pin no. type symbol tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b * 1 fp-100bv * 1 fp-100a * 2 fp-100av * 2 i/o function bus control lwr 72 75 output strobe signal: writes to the external bus to indicate valid data on the lower data bus (d7 to d0). wait 73 76 input requests insertion of wait states in bus cycle when accesses to the external three state address. 16-bit timer- pulse unit (tpu) tclkd tclkc tclkb tclka 41 39 37 36 44 42 40 39 input these pins input an external clock. tioca0 tiocb0 tiocc0 tiocd0 34 35 36 37 37 38 39 40 input/ output pins for the tgra_0 to tgrd_0 input capture input, output compare output, or pwm output. tioca1 tiocb1 38 39 41 42 input/ output pins for the tgra _ 1 and tgrb _ 1 input capture input, output compare output, or pwm output. tioca2 tiocb2 40 41 43 44 input/ output pins for the tgra _ 2 and tgrb _ 2 input capture input, output compare output, or pwm output. tioca3 tiocb3 tiocc3 tiocd3 22 23 24 25 25 26 27 28 input/ output pins for the tgra_3 to tgrd_3 input capture input, output compare output, or pwm output. (not available in the h8s/2227 group.) tioca4 tiocb4 26 27 29 30 input/ output pins for the tgra_4 and tgrb_4 input capture input, output compare output, or pwm output. (not available in the h8s/2227 group.) tioca5 tiocb5 28 29 31 32 input/ output pins for the tgra_5 and tgrb_5 input capture input, output compare output, or pwm output. (not available in the h8s/2227 group.) 8-bit timer tmo1 tmo0 87 88 90 91 output compare-match output pins. tmci01 90 93 input pin for external clock input to the counter. tmri01 90 93 input counter reset input pin. watchdog timer (wdt) buzz 74 77 output this pin outputs the pulse that is divided by watchdog timer.
section 1 overview rev. 5.00 aug 08, 2006 page 60 of 982 rej09b0054-0500 pin no. type symbol tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b * 1 fp-100bv * 1 fp-100a * 2 fp-100av * 2 i/o function txd3 txd2 txd1 txd0 83 31 79 76 86 34 82 79 output data output pins. (txd2 is not available in the h8s/2227 group.) serial communi- cation interface (sci)/ smart card interface rxd3 rxd2 rxd1 rxd0 84 32 80 77 87 35 83 80 input data input pins. (rxd2 is not available in the h8s/2227 group.) sck3 sck2 sck1 sck0 85 33 81 78 88 36 84 81 input/ output clock input/output pins. (sck2 is not available in the h8s/2227 group.) a/d converter an7 to an0 52 to 45 55 to 48 input analog input pins for the a/d converter. adtrg 72 75 input pin for input of an external trigger to start a/d conversion. d/a converter da1 da0 43 44 46 47 output analog output pins for the d/a converter. (not available in the h8s/2227 group.) a/d converter, d/a converter avcc 54 57 input power supply pin for the a/d converter and d/a converter. if none of the a/d converter and d/a converter is used, connect this pin to the system power supply. avss 42 45 input ground pin for the a/d converter and d/a converter. connect this pin to the system power supply (0 v). vref 53 56 input reference voltage input pin for the a/d converter and d/a converter. if neither the a/d converter nor d/a converter is used, connect this pin to the system power supply. i/o ports p17 to p10 41 to 34 44 to 37 input/ output 8-bit i/o pins. p36 to p30 82 to 76 85 to 79 input/ output 7-bit i/o pins.
section 1 overview rev. 5.00 aug 08, 2006 page 61 of 982 rej09b0054-0500 pin no. type symbol tfp-100b tfp-100bv tfp-100g tfp-100gv fp-100b * 1 fp-100bv * 1 fp-100a * 2 fp-100av * 2 i/o function i/o ports p47 to p40 52 to 45 55 to 48 input 8-bit input pins. p77 to p70 90 to 83 93 to 86 input/ output 8-bit i/o pins. p97 p96 43 44 46 47 input 2-bit input pins. pa3 to pa0 33 to 30 36 to 33 input/ output 4-bit i/o pins. pb7 to pb0 29 to 22 32 to 25 input/ output 8-bit i/o pins. pc7 to pc0 21 to 15, 13 24 to 18, 16 input/ output 8-bit i/o pins. pd7 to pd0 11 to 4 14 to 7 input/ output 8-bit i/o pins. pe7 to pe0 100 to 96, 3 to 1 100, 99, 6 to 1 input/ output 8-bit i/o pins. pf7 to pf0 75 to 68 78 to 71 input/ output 8-bit i/o pins. pg4 to pg0 95 to 91 98 to 94 input/ output 5-bit i/o pins. notes: 1. in h8s/2227 group, supported only by masked rom version. 2. in h8s/2227 group, supported only by the hd6432227. 3. measures should be taken to deal with noise, which can cause operation errors otherwise.
section 1 overview rev. 5.00 aug 08, 2006 page 62 of 982 rej09b0054-0500
section 2 cpu rev. 5.00 aug 08, 2006 page 63 of 982 rej09b0054-0500 section 2 cpu the h8s/2000 cpu is a high-speed central processing unit with an internal 32-bit architecture that is upward-compatible with the h8/300 and h8/300h cpus. the h8s/2000 cpu has sixteen 16-bit general registers, can address a 16-mbyte linear address space, and is ideal for realtime control. this section describes the h8s/2000 cpu. the usable modes and address spaces differ depending on the product. for details on each product, refer to section 3, mcu operating modes. 2.1 features ? upward-compatible with h8/300 and h8/300h cpu ? can execute h8/300 and h8/300h cpu object programs ? general-register architecture ? sixteen 16-bit general registers also usable as sixteen 8-bit registers or eight 32-bit registers ? sixty-five basic instructions ? 8/16/32-bit arithmetic and logic instructions ? multiply and divide instructions ? powerful bit-manipulation instructions ? eight addressing modes ? register direct [rn] ? register indirect [@ern] ? register indirect with displacement [@(d:16,ern) or @(d:32,ern)] ? register indirect with post-increment or pre-decrement [@ern+ or @?ern] ? absolute address [@aa:8, @aa:16, @aa:24, or @aa:32] ? immediate [#xx:8, #xx:16, or #xx:32] ? program-counter relative [@(d:8,pc) or @(d:16,pc)] ? memory indirect [@@aa:8] ? 16-mbyte address space ? program: 16 mbytes ? data: 16 mbytes
section 2 cpu rev. 5.00 aug 08, 2006 page 64 of 982 rej09b0054-0500 ? high-speed operation ? all frequently-used instructions execute in one or two states ? 8/16/32-bit register-register add/subtract : 1 state ? 8 8-bit register-register multiply : 12 states ? 16 8-bit register-register divide : 12 states ? 16 16-bit register-register multiply : 20 states ? 32 16-bit register-register divide : 20 states ? two cpu operating modes ? normal mode* ? advanced mode ? power-down state ? transition to power-down state by a sleep instruction ? cpu clock speed selection note: * normal mode is not available in this lsi. 2.1.1 differences between h8s/2600 cpu and h8s/2000 cpu the differences between the h8s/2600 cpu and the h8s/2000 cpu are shown below. ? register configuration ? the mac register is supported by the h8s/2600 cpu only. ? basic instructions ? the four instructions mac, clrmac, ldmac, and stmac are supported by the h8s/2600 cpu only. ? the number of execution states of the mulxu and mulxs instructions; execution states instruction mnemonic h8s/2600 h8s/2000 mulxu mulxu.b rs, rd 3 12 mulxu.w rs, erd 4 20 mulxs mulxs.b rs, rd 4 13 mulxs.w rs, erd 5 21 in addition, there are differences in address space, ccr and exr register functions, and power- down modes, etc., depending on the model.
section 2 cpu rev. 5.00 aug 08, 2006 page 65 of 982 rej09b0054-0500 2.1.2 differences from h8/300 cpu in comparison to the h8/300 cpu, the h8s/2000 cpu has the following enhancements: ? more general registers and control registers ? eight 16-bit expanded registers, and one 8-bit and two 32-bit control registers, have been added. ? expanded address space ? normal mode supports the same 64-kbyte address space as the h8/300 cpu. ? advanced mode supports a maximum 16-mbyte address space. ? enhanced addressing ? the addressing modes have been enhanced to make effective use of the 16-mbyte address space. ? enhanced instructions ? addressing modes of bit-manipulation instructions have been enhanced. ? signed multiply and divide instructions have been added. ? two-bit shift instructions have been added. ? instructions for saving and restoring multiple registers have been added. ? a test and set instruction has been added. ? higher speed ? basic instructions execute twice as fast. 2.1.3 differences from h8/300h cpu in comparison to the h8/300h cpu, the h8s/2000 cpu has the following enhancements: ? additional control register ? one 8-bit control registers have been added. ? enhanced instructions ? addressing modes of bit-manipulation instructions have been enhanced. ? two-bit shift instructions have been added. ? instructions for saving and restoring multiple registers have been added. ? a test and set instruction has been added. ? higher speed ? basic instructions execute twice as fast.
section 2 cpu rev. 5.00 aug 08, 2006 page 66 of 982 rej09b0054-0500 2.2 cpu operating modes the h8s/2000 cpu has two operating modes: normal and advanced. normal mode supports a maximum 64-kbyte address space. advanced mode supports a maximum 16-mbyte total address space. the mode is selected by the mode pins. 2.2.1 normal mode in normal mode, the exception vector table and stack have the same structure as the h8/300 cpu. ? address space linear access is provided to a maximum address space of 64 kbytes. ? extended registers (en) the extended registers (e0 to e7) can be used as 16-bit registers, or as the upper 16-bit segments of 32-bit registers. when en is used as a 16-bit register it can contain any value, even when the corresponding general register (rn) is used as an address register. if the general register is referenced in the register indirect addressing mode with pre-decrement (@?rn) or post-increment (@rn+) and a carry or borrow occurs, however, the value in the corresponding extended register (en) will be affected. ? instruction set all instructions and addressing modes can be used. only the lower 16 bits of effective addresses (ea) are valid. ? exception vector table and memory indirect branch addresses in normal mode the top area starting at h'0000 is allocated to the exception vector table. one branch address is stored per 16 bits. figure 2.1 shows the structure of the exception vector table in normal mode. for details of the exception vector table, see section 4, exception handling. the memory indirect addressing mode (@@aa:8) employed in the jmp and jsr instructions uses an 8-bit absolute address included in the instruction code to specify a memory operand that contains a branch address. in normal mode the operand is a 16-bit word operand, providing a 16-bit branch address. branch addresses can be stored in the top area from h'0000 to h'00ff. note that this area is also used for the exception vector table. ? stack structure in normal mode, when the program counter (pc) is pushed onto the stack in a subroutine call, and the pc, condition-code register (ccr) and extended control register (exr) are pushed onto the stack in exception handling, they are stored as shown in figure 2.2. exr is not pushed onto the stack in interrupt control mode 0. for details, see section 4, exception handling. note: normal mode is not available in this lsi.
section 2 cpu rev. 5.00 aug 08, 2006 page 67 of 982 rej09b0054-0500 h'0000 h'0001 h'0002 h'0003 h'0004 h'0005 h'0006 h'0007 h'0008 h'0009 h'000a h'000b reset exception vector (reserved for system use) exception vector 1 exception vector 2 exception vector table figure 2.1 exception vector table (normal mode) pc (16 bits) pc (16 bits) sp sp exr * 1 reserved * 1 * 3 ccr ccr * 3 (sp * 2 ) 1. when exr is not used it is not stored on the stack. 2. sp when exr is not used. 3. lgnored when returning. notes: (b) exception handling (a) subroutine branch figure 2.2 stack structure in normal mode 2.2.2 advanced mode ? address space linear access is provided to a maximum 16-mbyte address space. ? extended registers (en) the extended registers (e0 to e7) can be used as 16-bit registers, or as the upper 16-bit segments of 32-bit registers or address registers.
section 2 cpu rev. 5.00 aug 08, 2006 page 68 of 982 rej09b0054-0500 ? instruction set all instructions and addressing modes can be used. ? exception vector table and memory indirect branch addresses in advanced mode, the top area starting at h'00000000 is allocated to the exception vector table in units of 32 bits. in each 32 bits, the upper 8 bits are ignored and a branch address is stored in the lower 24 bits (figure 2.3). for details of the exception vector table, see section 4, exception handling. h'00000000 h'00000003 h'00000004 h'0000000b h'0000000c h'00000010 h'00000008 h'00000007 reserved reserved reset exception vector (reserved for system use) exception vector table exception vector 1 figure 2.3 exception vector table (advanced mode) the memory indirect addressing mode (@@aa:8) employed in the jmp and jsr instructions uses an 8-bit absolute address included in the instruction code to specify a memory operand that contains a branch address. in advanced mode, the operand is a 32-bit longword operand, providing a 32-bit branch address. the upper 8 bits of these 32 bits is a reserved area that is regarded as h'00. branch addresses can be stored in the area from h'00000000 to h'000000ff. note that the first part of this range is also the exception vector table.
section 2 cpu rev. 5.00 aug 08, 2006 page 69 of 982 rej09b0054-0500 ? stack structure in advanced mode, when the program counter (pc) is pushed onto the stack in a subroutine call, and the pc, condition-code register (ccr), and extended control register (exr) are pushed onto the stack in exception handling, they are stored as shown in figure 2.4. when exr is invalid, it is not pushed onto the stack. for details, see section 4, exception handling. pc (24 bits) pc (24 bits) sp sp exr * 1 reserved * 1 * 3 ccr (sp * 2 ) reserved (a) subroutine branch (b) exception handling notes: 1. when exr is not used it is not stored on the stack. 2. sp when exr is not used. 3. ignored when returning. figure 2.4 stack structure in advanced mode
section 2 cpu rev. 5.00 aug 08, 2006 page 70 of 982 rej09b0054-0500 2.3 address space figure 2.5 shows a memory map of the h8s/2000 cpu. the h8s/2000 cpu provides linear access to a maximum 64-kbyte address space in normal mode, and a maximum 16-mbyte (architecturally 4-gbyte) address space in advanced mode. the usable modes and address spaces differ depending on the product. for details on each product, refer to section 3, mcu operating modes. h'0000 h'ffff h'00000000 h'ffffffff h'00ffffff 64 kbytes 16 mbytes program area data area (b) advanced mode (a) normal mode * note: * normal mode is not available in this lsi. figure 2.5 memory map
section 2 cpu rev. 5.00 aug 08, 2006 page 71 of 982 rej09b0054-0500 2.4 register configuration the h8s/2000 cpu has the internal registers shown in figure 2.6. there are two types of registers: general registers and control registers. control registers are a 24-bit program counter (pc), an 8-bit extended control register (exr), and an 8-bit condition code register (ccr). ti2i1i0 exr 76543210 pc 23 0 15 0 7 0 7 0 e0 e1 e2 e3 e4 e5 e6 e7 r0h r1h r2h r3h r4h r5h r6h r7h r0l r1l r2l r3l r4l r5l r6l r7l sp: pc: exr: t: i2 to i0: ccr: i: ui: stack pointer program counter extended control register trace bit interrupt mask bits condition-code register interrupt mask bit user bit or interrupt mask bit * half-carry flag user bit negative flag zero flag overflow flag carry flag er0 er1 er2 er3 er4 er5 er6 er7 (sp) iuihunzvc ccr 76543210 h: u: n: z: v: c: general registers (rn) and extended registers (en) control registers (cr) legend: ---- note: * the interrupt mask bit is not available in this lsi. figure 2.6 cpu registers
section 2 cpu rev. 5.00 aug 08, 2006 page 72 of 982 rej09b0054-0500 2.4.1 general registers the h8s/2000 cpu has eight 32-bit general registers. these general registers are all functionally alike and can be used as both address registers and data registers. when a general register is used as a data register, it can be accessed as a 32-bit, 16-bit, or 8-bit register. figure 2.7 illustrates the usage of the general registers. when the general registers are used as 32-bit registers or address registers, they are designated by the letters er (er0 to er7). the er registers divide into 16-bit general registers designated by the letters e (e0 to e7) and r (r0 to r7). these registers are functionally equivalent, providing a maximum sixteen 16-bit registers. the e registers (e0 to e7) are also referred to as extended registers. the r registers divide into 8-bit general registers designated by the letters rh (r0h to r7h) and rl (r0l to r7l). these registers are functionally equivalent, providing a maximum sixteen 8-bit registers. the usage of each register can be selected independently. general register er7 has the function of stack pointer (sp) in addition to its general-register function, and is used implicitly in exception handling and subroutine calls. figure 2.8 shows the stack. address registers 32-bit registers 16-bit registers 8-bit registers er registers (er0 to er7) e registers (extended registers) (e0 to e7) r registers (r0 to r7) rh registers (r0h to r7h) rl registers (r0l to r7l) figure 2.7 usage of general registers
section 2 cpu rev. 5.00 aug 08, 2006 page 73 of 982 rej09b0054-0500 sp (er7) free area stack area figure 2.8 stack status 2.4.2 program counter (pc) this 24-bit counter indicates the address of the next instruction the cpu will execute. the length of all cpu instructions is 2 bytes (one word), so the least significant pc bit is ignored (when an instruction is fetched, the least significant pc bit is regarded as 0). 2.4.3 extended control register (exr) exr is an 8-bit register that manipulates the ldc, stc, andc, orc, and xorc instructions. when these instructions except for the stc instruction is executed, all interrupts including nmi will be masked for three states after execution is completed. bit bit name initial value r/w description 7 t 0 r/w trace bit when this bit is set to 1, a trace exception is generated each time an instruction is executed. when this bit is cleared to 0, instructions are executed in sequence. 6 to 3 ? all 1 ? reserved these bits are always read as 1. 2 1 0 i2 i1 i0 1 1 1 r/w r/w r/w these bits designate the interrupt mask level (0 to 7). for details, refer to section 5, interrupt controller.
section 2 cpu rev. 5.00 aug 08, 2006 page 74 of 982 rej09b0054-0500 2.4.4 condition-code register (ccr) this 8-bit register contains internal cpu status information, including an interrupt mask bit (i) and half-carry (h), negative (n), zero (z), overflow (v), and carry (c) flags. operations can be performed on the ccr bits by the ldc, stc, andc, orc, and xorc instructions. the n, z, v, and c flags are used as branching conditions for conditional branch (bcc) instructions. bit bit name initial value r/w description 7 i 1 r/w interrupt mask bit masks interrupts other than nmi when set to 1. nmi is accepted regardless of the i bit setting. the i bit is set to 1 by hardware at the start of an exception-handling sequence. for details, refer to section 5, interrupt controller. 6 ui undefined r/w user bit or interrupt mask bit can be written and read by software using the ldc, stc, andc, orc, and xorc instructions. this bit cannot be used as an interrupt mask bit in this lsi. 5 h undefined r/w half-carry flag when the add.b, addx.b, sub.b, subx.b, cmp.b, or neg.b instruction is executed, this flag is set to 1 if there is a carry or borrow at bit 3, and cleared to 0 otherwise. when the add.w, sub.w, cmp.w, or neg.w instruction is executed, the h flag is set to 1 if there is a carry or borrow at bit 11, and cleared to 0 otherwise. when the add.l, sub.l, cmp.l, or neg.l instruction is executed, the h flag is set to 1 if there is a carry or borrow at bit 27, and cleared to 0 otherwise. 4 u undefined r/w user bit can be written and read by software using the ldc, stc, andc, orc, and xorc instructions. 3 n undefined r/w negative flag stores the value of the most significant bit of data as a sign bit.
section 2 cpu rev. 5.00 aug 08, 2006 page 75 of 982 rej09b0054-0500 bit bit name initial value r/w description 2 z undefined r/w zero flag set to 1 to indicate zero data, and cleared to 0 to indicate non-zero data. 1 v undefined r/w overflow flag set to 1 when an arithmetic overflow occurs, and cleared to 0 at other times. 0 c undefined r/w carry flag set to 1 when a carry occurs, and cleared to 0 otherwise. used by: ? add instructions, to indicate a carry ? subtract instructions, to indicate a borrow ? shift and rotate instructions, to indicate a carry the carry flag is also used as a bit accumulator by bit manipulation instructions. 2.4.5 initial values of cpu registers reset exception handling loads the cpu?s program counter (pc) from the vector table, clears the trace bit in exr to 0, and sets the interrupt mask bits in ccr and exr to 1. the other ccr bits and the general registers are not initialized. in particular, the stack pointer (er7) is not initialized. the stack pointer should therefore be initialized by an mov.l instruction executed immediately after a reset.
section 2 cpu rev. 5.00 aug 08, 2006 page 76 of 982 rej09b0054-0500 2.5 data formats the h8s/2000 cpu can process 1-bit, 4-bit (bcd), 8-bit (byte), 16-bit (word), and 32-bit (longword) data. bit-manipulation instructions operate on 1-bit data by accessing bit n (n = 0, 1, 2,?, 7) of byte operand data. the daa and das decimal-adjust instructions treat byte data as two digits of 4-bit bcd data. 2.5.1 general register data formats figure 2.9 shows the data formats in general registers. 70 70 msb lsb msb lsb 70 43 don't care don't care don't care 70 43 70 don't care 65432 710 70 don't care 65432 710 don't care data type register number data format byte data byte data 4-bit bcd data 4-bit bcd data 1-bit data 1-bit data rnh rnl rnh rnl rnh rnl upper lower upper lower figure 2.9 general register data formats (1)
section 2 cpu rev. 5.00 aug 08, 2006 page 77 of 982 rej09b0054-0500 15 0 msb lsb 15 0 msb lsb 31 16 msb 15 0 lsb en rn ern: en: rn: rnh: rnl: msb: lsb: general register er general register e general register r general register rh general register rl most significant bit least significant bit data type data format register number word data word data rn en longword data legend: ern figure 2.9 general register data formats (2)
section 2 cpu rev. 5.00 aug 08, 2006 page 78 of 982 rej09b0054-0500 2.5.2 memory data formats figure 2.10 shows the data formats in memory. the h8s/2000 cpu can access word data and longword data in memory, but word or longword data must begin at an even address. if an attempt is made to access word or longword data at an odd address, no address error occurs but the least significant bit of the address is regarded as 0, so the access starts at the preceding address. this also applies to instruction fetches. when er7 is used as an address register to access the stack, the operand size should be word or longword. 70 76 543210 msb lsb msb msb lsb lsb data type address 1-bit data byte data word data address l address l address 2m address 2m + 1 longword data address 2n address 2n + 1 address 2n + 2 address 2n + 3 data format figure 2.10 memory data formats
section 2 cpu rev. 5.00 aug 08, 2006 page 79 of 982 rej09b0054-0500 2.6 instruction set the h8s/2000 cpu has 65 types of instructions. the instructions are classified by function in table 2.1. table 2.1 instruction classification function instructions size types data transfer mov b/w/l 5 pop * 1 , push * 1 w/l ldm, stm l movfpe * 3 , movtpe * 3 b add, sub, cmp, neg b/w/l 19 arithmetic operations addx, subx, daa, das b inc, dec b/w/l adds, subs l mulxu, divxu, mulxs, divxs b/w extu, exts w/l tas * 4 b logic operations and, or, xor, not b/w/l 4 shift shal, shar, shll, shlr, rotl, rotr, rotxl, rotxr b/w/l 8 bit manipulation bset, bclr, bnot, btst, bld, bild, bst, bist, band, biand, bor, bior, bxor, bixor b14 branch bcc * 2 , jmp, bsr, jsr, rts ? 5 system control trapa, rte, sleep, ldc, stc, andc, orc, xorc, nop ? 9 block data transfer eepmov ? 1 total: 65 legend: b: byte w: word l: longword notes: 1. pop.w rn and push.w rn are identical to mov.w @sp+, rn and mov.w rn, @-sp. pop.l ern and push.l ern are identical to mov.l @sp+, ern and mov.l ern, @-sp. 2. bcc is the general name for conditional branch instructions. 3. cannot be used in this lsi. 4. only register er0, er1, er4, or er5 should be used when using the tas instruction.
section 2 cpu rev. 5.00 aug 08, 2006 page 80 of 982 rej09b0054-0500 2.6.1 table of instructions classified by function tables 2.3 to 2.10 summarize the instructions in each functional category. the notation used in tables 2.3 to 2.10 is defined below. table 2.2 operation notation symbol description rd general register (destination) * rs general register (source) * rn general register * ern general register (32-bit register) (ead) destination operand (eas) source operand exr extended control register ccr condition-code register n n (negative) flag in ccr z z (zero) flag in ccr v v (overflow) flag in ccr c c (carry) flag in ccr pc program counter sp stack pointer #imm immediate data disp displacement + addition ? subtraction multiplication division logical and logical or logical xor move ? not (logical complement) :8/:16/:24/:32 8-, 16-, 24-, or 32-bit length note: * general registers include 8-bit registers (r0h to r7h, r0l to r7l), 16-bit registers (r0 to r7, e0 to e7), and 32-bit registers (er0 to er7).
section 2 cpu rev. 5.00 aug 08, 2006 page 81 of 982 rej09b0054-0500 table 2.3 data transfer instructions instruction size * function mov b/w/l (eas) rd, rs (ead) moves data between two general registers or between a general register and memory, or moves immediate data to a general register. movfpe b cannot be used in this lsi. movtpe b cannot be used in this lsi. pop w/l @sp+ rn pops a general register from the stack. pop.w rn is identical to mov.w @sp+, rn. pop.l ern is identical to mov.l @sp+, ern. push w/l rn @?sp pushes a general register onto the stack. push.w rn is identical to mov.w rn, @?sp. push.l ern is identical to mov.l ern, @?sp. ldm l @sp+ rn (register list) pops two or more general registers from the stack. stm l rn (register list) @?sp pushes two or more general registers onto the stack. note: * refers to the operand size. b: byte w: word l: longword
section 2 cpu rev. 5.00 aug 08, 2006 page 82 of 982 rej09b0054-0500 table 2.4 arithmetic operations instructions instruction size * 1 function add sub b/w/l rd rs rd, rd #imm rd performs addition or subtraction on data in two general registers, or on immediate data and data in a general register. (immediate byte data cannot be subtracted from byte data in a general register. use the subx or add instruction.) addx subx b rd rs c rd, rd #imm c rd performs addition or subtraction with carry on byte data in two general registers, or on immediate data and data in a general register. inc dec b/w/l rd 1 rd, rd 2 rd increments or decrements a general register by 1 or 2. (byte operands can be incremented or decremented by 1 only.) adds subs l rd 1 rd, rd 2 rd, rd 4 rd adds or subtracts the value 1, 2, or 4 to or from data in a 32-bit register. daa das b rd decimal adjust rd decimal-adjusts an addition or subtraction result in a general register by referring to the ccr to produce 4-bit bcd data. mulxu b/w rd rs rd performs unsigned multiplication on data in two general registers: either 8 bits 8 bits 16 bits or 16 bits 16 bits 32 bits. mulxs b/w rd rs rd performs signed multiplication on data in two general registers: either 8 bits 8 bits 16 bits or 16 bits 16 bits 32 bits. divxu b/w rd rs rd performs unsigned division on data in two general registers: either 16 bits 8 bits 8-bit quotient and 8-bit remainder or 32 bits 16 bits 16-bit quotient and 16-bit remainder.
section 2 cpu rev. 5.00 aug 08, 2006 page 83 of 982 rej09b0054-0500 instruction size * 1 function divxs b/w rd rs rd performs signed division on data in two general registers: either 16 bits 8 bits 8-bit quotient and 8-bit remainder or 32 bits 16 bits 16-bit quotient and 16-bit remainder. cmp b/w/l rd ? rs, rd ? #imm compares data in a general register with data in another general register or with immediate data, and sets ccr bits according to the result. neg b/w/l 0 ? rd rd takes the two?s complement (arithmetic complement) of data in a general register. extu w/l rd (zero extension) rd extends the lower 8 bits of a 16-bit register to word size, or the lower 16 bits of a 32-bit register to longword size, by padding with zeros on the left. exts w/l rd (sign extension) rd extends the lower 8 bits of a 16-bit register to word size, or the lower 16 bits of a 32-bit register to longword size, by extending the sign bit. tas * 2 b @erd ? 0, 1 ( of @erd) tests memory contents, and sets the most significant bit (bit 7) to 1. notes: 1. refers to the operand size. b: byte w: word l: longword 2. only register er0, er1, er4, or er5 should be used when using the tas instruction.
section 2 cpu rev. 5.00 aug 08, 2006 page 84 of 982 rej09b0054-0500 table 2.5 logic operations instructions instruction size * function and b/w/l rd rs rd, rd #imm rd performs a logical and operation on a general register and another general register or immediate data. or b/w/l rd rs rd, rd #imm rd performs a logical or operation on a general register and another general register or immediate data. xor b/w/l rd rs rd, rd #imm rd performs a logical exclusive or operation on a general register and another general register or immediate data. not b/w/l ? rd rd takes the one?s complement of general register contents. note: * refers to the operand size. b: byte w: word l: longword table 2.6 shift instructions instruction size * function shal shar b/w/l rd (shift) rd performs an arithmetic shift on general register contents. 1-bit or 2-bit shifts are possible. shll shlr b/w/l rd (shift) rd performs a logical shift on general register contents. 1-bit or 2-bit shifts are possible. rotl rotr b/w/l rd (rotate) rd rotates general register contents. 1-bit or 2-bit rotations are possible. rotxl rotxr b/w/l rd (rotate) rd rotates general register contents through the carry flag. 1-bit or 2-bit rotations are possible. note: * refers to the operand size. b: byte w: word l: longword
section 2 cpu rev. 5.00 aug 08, 2006 page 85 of 982 rej09b0054-0500 table 2.7 bit manipulation instructions instruction size * function bset b 1 ( of ) sets a specified bit in a general register or memory operand to 1. the bit number is specified by 3-bit immediate data or the lower three bits of a general register. bclr b 0 ( of ) clears a specified bit in a general register or memory operand to 0. the bit number is specified by 3-bit immediate data or the lower three bits of a general register. bnot b ? ( of ) ( of ) inverts a specified bit in a general register or memory operand. the bit number is specified by 3-bit immediate data or the lower three bits of a general register. btst b ? ( of ) z tests a specified bit in a general register or memory operand and sets or clears the z flag accordingly. the bit number is specified by 3-bit immediate data or the lower three bits of a general register. band biand b b c ( of ) c ands the carry flag with a specified bit in a general register or memory operand and stores the result in the carry flag. c ? ( of ) c ands the carry flag with the inverse of a specified bit in a general register or memory operand and stores the result in the carry flag. the bit number is specified by 3-bit immediate data. bor bior b b c ( of ) c ors the carry flag with a specified bit in a general register or memory operand and stores the result in the carry flag. c ? ( of ) c ors the carry flag with the inverse of a specified bit in a general register or memory operand and stores the result in the carry flag. the bit number is specified by 3-bit immediate data.
section 2 cpu rev. 5.00 aug 08, 2006 page 86 of 982 rej09b0054-0500 instruction size * function bxor bixor b b c ( of ) c xors the carry flag with a specified bit in a general register or memory operand and stores the result in the carry flag. c ? ( of ) c xors the carry flag with the inverse of a specified bit in a general register or memory operand and stores the result in the carry flag. the bit number is specified by 3-bit immediate data. bld bild b b ( of ) c transfers a specified bit in a general register or memory operand to the carry flag. ? ( of ) c transfers the inverse of a specified bit in a general register or memory operand to the carry flag. the bit number is specified by 3-bit immediate data. bst bist b b c ( of ) transfers the carry flag value to a specified bit in a general register or memory operand. ? c ( of ) transfers the inverse of the carry flag value to a specified bit in a general register or memory operand. the bit number is specified by 3-bit immediate data. note: * refers to the operand size. b: byte
section 2 cpu rev. 5.00 aug 08, 2006 page 87 of 982 rej09b0054-0500 table 2.8 branch instructions instruction size function bcc ? branches to a specified address if a specified condition is true. the branching conditions are listed below. mnemonic description condition bra(bt) always (true) always brn(bf) never (false) never bhi high c z = 0 bls low or same c z = 1 bcc(bhs) carry clear (high or same) c = 0 bcs(blo) carry set (low) c = 1 bne not equal z = 0 beq equal z = 1 bvc overflow clear v = 0 bvs overflow set v = 1 bpl plus n = 0 bmi minus n = 1 bge greater or equal n v = 0 blt less than n v = 1 bgt greater than z (n v) = 0 ble less or equal z (n v) = 1 jmp ? branches unconditionally to a specified address. bsr ? branches to a subroutine at a specified address. jsr ? branches to a subroutine at a specified address. rts ? returns from a subroutine
section 2 cpu rev. 5.00 aug 08, 2006 page 88 of 982 rej09b0054-0500 table 2.9 system control instructions instruction size * function trapa ? starts trap-instruction exception handling. rte ? returns from an exception-handling routine. sleep ? causes a transition to a power-down state. ldc b/w (eas) ccr, (eas) exr moves the source operand contents or immediate data to ccr or exr. although ccr and exr are 8-bit registers, word-size transfers are performed between them and memory. the upper 8 bits are valid. stc b/w ccr (ead), exr (ead) transfers ccr or exr contents to a general register or memory. although ccr and exr are 8-bit registers, word-size transfers are performed between them and memory. the upper 8 bits are valid. andc b ccr #imm ccr, exr #imm exr logically ands the ccr or exr contents with immediate data. orc b ccr #imm ccr, exr #imm exr logically ors the ccr or exr contents with immediate data. xorc b ccr #imm ccr, exr #imm exr logically xors the ccr or exr contents with immediate data. nop ? pc + 2 pc only increments the program counter. note: * refers to the operand size. b: byte w: word
section 2 cpu rev. 5.00 aug 08, 2006 page 89 of 982 rej09b0054-0500 table 2.10 block data transfer instructions instruction size function eepmov.b ? if r4l 0 then repeat @er5+ @er6+ r4l?1 r4l until r4l = 0 else next; eepmov.w ? if r4 0 then repeat @er5+ @er6+ r4?1 r4 until r4 = 0 else next; transfers a data block. starting from the address set in er5, transfers data for the number of bytes set in r4l or r4 to the address location set in er6. execution of the next instruction begins as soon as the transfer is completed. 2.6.2 basic instruction formats the h8s/2000 cpu instructions consist of 2-byte (1-word) units. an instruction consists of an operation field (op), a register field (r), an effective address extension (ea), and a condition field (cc). figure 2.11 shows examples of instruction formats. ? operation field indicates the function of the instruction, the addressing mode, and the operation to be carried out on the operand. the operation field always includes the first four bits of the instruction. some instructions have two operation fields. ? register field specifies a general register. address registers are specified by 3 bits, and data registers by 3 bits or 4 bits. some instructions have two register fields. some have no register field. ? effective address extension 8, 16, or 32 bits specifying immediate data, an absolute address, or a displacement. ? condition field specifies the branching condition of bcc instructions.
section 2 cpu rev. 5.00 aug 08, 2006 page 90 of 982 rej09b0054-0500 op op rn rm nop, rts, etc. add.b rn, rm, etc. mov.b @(d:16, rn), rm, etc. rn rm op ea(disp) op cc ea(disp) bra d:16, etc. (1) operation field only (2) operation field and register fields (3) operation field, register fields, and effective address extension (4) operation field, effective address extension, and condition field figure 2.11 instruction formats (examples) 2.7 addressing modes and effective address calculation the h8s/2000 cpu supports the eight addressing modes listed in table 2.11. each instruction uses a subset of these addressing modes. arithmetic and logic instructions can use the register direct and immediate modes. data transfer instructions can use all addressing modes except program- counter relative and memory indirect. bit manipulation instructions use register direct, register indirect, or the absolute addressing mode to specify an operand, and register direct (bset, bclr, bnot, and btst instructions) or immediate (3-bit) addressing mode to specify a bit number in the operand. table 2.11 addressing modes no. addressing mode symbol 1 register direct rn 2 register indirect @ern 3 register indirect with displacement @(d:16,ern)/@(d:32,ern) 4 register indirect with post-increment register indirect with pre-decrement @ern+ @?ern 5 absolute address @aa:8/@aa:16/@aa:24/@aa:32 6 immediate #xx:8/#xx:16/#xx:32 7 program-counter relative @(d:8,pc)/@(d:16,pc) 8 memory indirect @@aa:8
section 2 cpu rev. 5.00 aug 08, 2006 page 91 of 982 rej09b0054-0500 2.7.1 register direct?rn the register field of the instruction specifies an 8-, 16-, or 32-bit general register containing the operand. r0h to r7h and r0l to r7l can be specified as 8-bit registers. r0 to r7 and e0 to e7 can be specified as 16-bit registers. er0 to er7 can be specified as 32-bit registers. 2.7.2 register indirect?@ern the register field of the instruction code specifies an address register (ern) which contains the address of the operand on memory. if the address is a program instruction address, the lower 24 bits are valid and the upper 8 bits are all assumed to be 0 (h'00). 2.7.3 register indirect with displacement?@(d:16, ern) or @(d:32, ern) a 16-bit or 32-bit displacement contained in the instruction is added to an address register (ern) specified by the register field of the instruction, and the sum gives the address of a memory operand. a 16-bit displacement is sign-extended when added. 2.7.4 register indirect with post-increment?@ern+ or register indirect with pre- decrement?@-ern register indirect with post-increment?@ern+: the register field of the instruction code specifies an address register (ern) which contains the address of a memory operand. after the operand is accessed, 1, 2, or 4 is added to the address register contents and the sum is stored in the address register. the value added is 1 for byte access, 2 for word transfer instruction, or 4 for longword transfer instruction. for the word or longword transfer instructions, the register value should be even. register indirect with pre-decrement?@-ern: the value 1, 2, or 4 is subtracted from an address register (ern) specified by the register field in the instruction code, and the result is the address of a memory operand. the result is also stored in the address register. the value subtracted is 1 for byte access, 2 for word transfer instruction, or 4 for longword transfer instruction. for the word or longword transfer instructions, the register value should be even. 2.7.5 absolute address?@aa:8, @aa:16, @aa:24, or @aa:32 the instruction code contains the absolute address of a memory operand. the absolute address may be 8 bits long (@aa:8), 16 bits long (@aa:16), 24 bits long (@aa:24), or 32 bits long (@aa:32). table 2.12 indicates the accessible absolute address ranges.
section 2 cpu rev. 5.00 aug 08, 2006 page 92 of 982 rej09b0054-0500 to access data, the absolute address should be 8 bits (@aa:8), 16 bits (@aa:16), or 32 bits (@aa:32) long. for an 8-bit absolute address, the upper 24 bits are all assumed to be 1 (h'ffff). for a 16-bit absolute address the upper 16 bits are a sign extension. a 32-bit absolute address can access the entire address space. a 24-bit absolute address (@aa:24) indicates the address of a program instruction. the upper 8 bits are all assumed to be 0 (h'00). table 2.12 absolute address access ranges absolute address normal mode * advanced mode data address 8 bits (@aa:8) h'ff00 to h'ffff h'ffff00 to h'ffffff 16 bits (@aa:16) h'0000 to h'ffff h'000000 to h'007fff, h'ff8000 to h'ffffff 32 bits (@aa:32) h'000000 to h'ffffff program instruction address 24 bits (@aa:24) note: * normal mode is not available in this lsi. 2.7.6 immediate ? #xx:8, #xx:16, or #xx:32 the instruction contains 8-bit (#xx:8), 16-bit (#xx:16), or 32-bit (#xx:32) immediate data as an operand. the adds, subs, inc and dec instructions contain immediate data implicitly. some bit manipulation instructions contain 3-bit immediate data in the instruction code, specifying a bit number. the trapa instruction contains 2-bit immediate data in its instruction code, specifying a vector address. 2.7.7 program-counter relative?@(d:8, pc) or @(d:16, pc) this mode is used in the bcc and bsr instructions. an 8-bit or 16-bit displacement contained in the instruction is sign-extended and added to the 24-bit pc contents to generate a branch address. only the lower 24 bits of this branch address are valid; the upper 8 bits are all assumed to be 0 (h'00). the pc value to which the displacement is added is the address of the first byte of the next instruction, so the possible branching range is ?126 to +128 bytes (?63 to +64 words) or ?32766 to +32768 bytes (?16383 to +16384 words) from the branch instruction. the resulting value should be an even number.
section 2 cpu rev. 5.00 aug 08, 2006 page 93 of 982 rej09b0054-0500 2.7.8 memory indirect?@@aa:8 this mode can be used by the jmp and jsr instructions. the instruction code contains an 8-bit absolute address specifying a memory operand. this memory operand contains a branch address. the upper bits of the absolute address are all assumed to be 0, so the address range is 0 to 255 (h'0000 to h'00ff in normal mode*, h'000000 to h'0000ff in advanced mode). in normal mode, the memory operand is a word operand and the branch address is 16 bits long. in advanced mode, the memory operand is a longword operand, the first byte of which is assumed to be 0 (h'00). note that the first part of the address range is also the exception vector area. for further details, refer to section 4, exception handling. if an odd address is specified in word or longword memory access, or as a branch address, the least significant bit is regarded as 0, causing data to be accessed or instruction code to be fetched at the address preceding the specified address (for further information, see section 2.5.2, memory data formats). note: * normal mode is not available in this lsi. specified by @aa:8 specified by @aa:8 branch address branch address reserved (a) normal mode * (a) advanced mode note: * normal mode is not available in this lsi. figure 2.12 branch address specification in memory indirect mode
section 2 cpu rev. 5.00 aug 08, 2006 page 94 of 982 rej09b0054-0500 2.7.9 effective address calculation table 2.13 indicates how effective addresses are calculated in each addressing mode. in normal mode the upper 8 bits of the effective address are ignored in order to generate a 16-bit address. table 2.13 effective address calculation no 1 offset 1 2 4 r op 31 0 31 23 2 3 register indirect with d isplacement @(d:16,ern) or @ (d:32,ern) 4 r op disp r op rm op rn 31 0 31 0 r op don't care 31 23 31 0 don't care 31 0 disp 31 0 31 0 31 23 31 0 don't care 31 23 31 0 don't care 24 24 24 24 addressing mode and instruction format effective address calculation effective address (ea) register direct(rn) general register contents general register contents general register contents general register contents sign extension register indirect(@ern) register indirect with post-increment or pre-decrement register indirect with post-increment @ern+ register indirect with pre-decrement @-ern 1, 2, or 4 1, 2, or 4 operand size byte word longword operand is general register contents.
section 2 cpu rev. 5.00 aug 08, 2006 page 95 of 982 rej09b0054-0500 no 5 op 31 23 31 0 don't care abs op abs op abs @aa:8 7 h'ffff op 31 23 31 0 don't care @aa:16 op @aa:24 @aa:32 abs 15 16 31 23 31 0 don't care 31 23 31 0 don't care abs op abs 6 op imm op #xx:8/#xx:16/#xx:32 8 24 24 24 24 23 0 23 0 31 23 0 don't care 24 addressing mode and instruction format absolute address immediate effective address calculation effective address (ea) sign extension 15 31 23 31 0 don't care 24 16 h'00 31 23 31 0 don't care 24 7 31 31 0 abs 8 7 8 h'000000 h'000000 31 31 0 abs operand is immediate data. 7 8 program-counter relative @(d:8,pc)/@(d:16,pc) pc contents 15 0 memory contents 31 31 0 memory contents disp sign extension disp note: * normal mode is not available in this lsi. memory indirect @@aa:8 ? nomal mode * ? advanced extended modes
section 2 cpu rev. 5.00 aug 08, 2006 page 96 of 982 rej09b0054-0500 2.8 processing states the h8s/2000 cpu has five main processing states: the reset state, exception handling state, program execution state, bus-released state, and power-down state. figure 2.13 indicates the state transitions. ? reset state in this state, the cpu and all on-chip peripheral modules are initialized and not operating. when the res input goes low, all current processing stops and the cpu enters the reset state. all interrupts are masked in the reset state. reset exception handling starts when the res signal changes from low to high. for details, refer to section 4, exception handling. the reset state can also be entered by a watchdog timer overflow. ? exception-handling state the exception-handling state is a transient state that occurs when the cpu alters the normal processing flow due to an exception source, such as a reset, trace, interrupt, or trap instruction. the cpu fetches a start address (vector) from the exception vector table and branches to that address. for further details, refer to section 4, exception handling. ? program execution state in this state, the cpu executes program instructions in sequence. ? bus-released state in a product which has a dma controller (dmac)* or data transfer controller (dtc), the bus- released state occurs when the bus has been released in response to a bus request from a bus master other than the cpu. while the bus is released, the cpu halts operations. ? power-down state this is a power-down state in which the cpu stops operating. the program stop state occurs when a sleep instruction is executed or the cpu enters hardware standby mode. for further details, refer to section 24, power-down modes. note: * supported only by the h8s/2239 group.
section 2 cpu rev. 5.00 aug 08, 2006 page 97 of 982 rej09b0054-0500 exception handling state bus-released state hardware standby mode * 2 software standby mode reset state * 1 sleep mode power-down state * 3 program execution state end of bus request bus request interrupt request external interrupt request res = high, mres = high request for exc eption handling stby = high, res = low end of bus reque st bus request sleep instruc tion, ss by = 0 sleep instruc tion, ssby = 1 notes: 1. 2. 3. from any state except hardware standby mode, a transition to the reset state occurs whenever res goes low. a transition can also be made to the reset state when the watchdog timer overflows. from any state except hardware standby mode and power-on reset state, a transition to the manual reset state occurs whenever mres goes low. from any state, a transition to hardware standby mode occurs when stby goes low. apart from these states, there are also the watch mode, subactive mode, and the subsleep mode. see section 24, power-down modes. end of exception handlin g figure 2.13 state transitions
section 2 cpu rev. 5.00 aug 08, 2006 page 98 of 982 rej09b0054-0500 2.9 usage notes 2.9.1 tas instruction only register er0, er1, er4, or er5 should be used when using the tas instruction. the tas instruction is not generated by the renesas technology h8s and h8/300 series c/c++ compilers. if the tas instruction is used as a user-defined intrinsic function, ensure that only register er0, er1, er4, or er5 is used. 2.9.2 stm/ldm instruction with the stm or ldm instruction, the er7 register is used as the stack pointer, and thus cannot be used as a register that allows save (stm) or restore (ldm) operation. with a single stm or ldm instruction, two to four registers can be saved or restored. the available registers are as follows: for two registers: er0 and er1, er2 and er3, or er4 and er5 for three registers: er0 to er2, or er4 to er6 for four registers: er0 to er3 for the renesas technology h8s or h8/300 series c/c++ compiler, the stm/ldm instruction including er7 is not created. 2.9.3 bit manipulation instructions when a register that includes write-only bits is manipulated by a bit manipulation instruction, there are cases where the bits manipulated are not manipulated correctly or bits unrelated to the bits manipulated are changed. when a register containing write-only bits is read, the value read is either a fixed value or an undefined value. this means that the bit manipulation instructions that use the value of bits read in their operation (bnot, btst, band, biand, bor, bior, bxor, bixor, bld, and bild) will not perform correct bit operations. also, bit manipulation instructions that perform a write operation on the data read after the calculation (bset, bclr, bnot, bst, and bist) may change bits unrelated to the bits manipulated. thus extreme care is required when performing bit manipulation instructions on registers that include write-only bits.
section 2 cpu rev. 5.00 aug 08, 2006 page 99 of 982 rej09b0054-0500 the bset, bclr, bnot, bst, and bist instructions perform their operations in the following order. 1. read the data in byte units 2. perform the bit manipulation operation according to the instruction on the data read 3. write the data back in byte units example: using the bclr instruction to clear only bit 4 in the port 1 p1ddr register. the p1ddr register consists of 8 write-only bits and sets the i/o direction of the port 1 pins. reading this register is invalid. when read, the values returned are undefined. here we present an example in which p14 is specified to be an input port using the bclr instruction. currently, p17 to p14 are set to be output pins and p13 to p10 are set to be input pins. at this point, the value of p1ddr is h'f0. p17 p16 p15 p14 p13 p12 p11 p10 i/o output output output output input input input input p1ddr 1 1 1 1 0 0 0 0 to switch p14 from the output pin to the input pin function, the value of p1ddr bit 4 must be changed from 1 to 0 (h'f0 h'e0). here we assume that the bclr instruction is used to clear p1ddr bit 4. bclr #4,@p1ddr however if a bit manipulation instruction of the type shown above is used on p1ddr, which is a write-only register, the following problem may occur. although the first thing that happens is that data is read from p1ddr in byte units, the value read at this time is undefined. an undefined value is a value that is either 0 or 1 in the register but reads out as an arbitrary value whose relationship to the actual value is unknown. since the p1ddr bits are all write-only bits, every bit reads out as an undefined value. although the actual value of p1ddr at this point is h'f0, assume that bit 3 becomes a 1 here, and the value read out is h'f8. p17 p16 p15 p14 p13 p12 p11 p10 i/o output output output output input input input input p1ddr 1 1 1 1 0 0 0 0 read value 1 1 1 1 1000
section 2 cpu rev. 5.00 aug 08, 2006 page 100 of 982 rej09b0054-0500 the bit manipulation operation is performed on this value that was read. in this example, bit 4 will be cleared for h'f8. p17 p16 p15 p14 p13 p12 p11 p10 i/o output output output output input input input input p1ddr 1 1 1 1 0 0 0 0 after bit manipulation 111 0 1 000 after the bit manipulation operation, this data will be written to p1ddr, and the bclr instruction completes. p17 p16 p15 p14 p13 p12 p11 p10 i/o output output output input output input input input p1ddr 1 1 1 0 1000 write value 1 1 1 0 1000 although the instruction was expected to write h'e0 back to p1ddr, it actually wrote h'e8, and p13, which was expected to be an input pin, is changed to function as an output pin. while this section described the case where p13 was read out as a 1, since the values read are undefined when p17 to p10 are read, when this bit manipulation instruction completes, bits that were 0 may be changed to 1, and bits that were 1 may be changed to 0. to avoid this sort of problem, see section 2.9.4, access methods for registers with write-only bits for methods for modifying registers that include write-only bits. also note that it is possible to use the bclr instruction to clear to 0 flags in internal i/o registers. in this case, if it is clear from the interrupt handler or other information that the corresponding flag is set to 1, then there is no need to read the value of the corresponding flag in advance. 2.9.4 access methods for registers with write-only bits undefined values will be read out if a data transfer instruction is executed for a register that includes write-only bits, or if a bit manipulation instruction is executed for a register that includes write-only bits. to avoid reading undefined values, use methods such as those shown below to access registers that include write-only bits. the basic method for writing to a register that includes write-only bits is to create a work area in internal ram or other memory area and first write the data to that area. then, perform the desired access operation for that memory and finally write that data to the register that includes write-only bits.
section 2 cpu rev. 5.00 aug 08, 2006 page 101 of 982 rej09b0054-0500 write data to the work area write the work area data to the register that includes write-only bits access the work area data (data transfer and bit manipulation instructions can be used) write the work area data to the register that includes write-only bits initial value write modifying the value of a registe r that includes write-only bits figure 2.14 flowchart for access methods for registers that include write-only bits example: to clear only bit 4 in the port 1 p1ddr the p1ddr register consists of 8 write-only bits and sets the i/o direction of the port 1 pins. reading this register is invalid. when read, the values returned are undefined. here we present an example in which p14 is specified to be an input port using the bclr instruction. first, we write the initial value h'f0 written to p1ddr to the work area in ram (ram0). mov.b #h'f0, r0l mov.b r0l, @pam0 mov.b r0l, @p1ddr p17 p16 p15 p14 p13 p12 p11 p10 i/o output output output output input input input input p1ddr 1 1 1 1 0 0 0 0 ram0 11110000
section 2 cpu rev. 5.00 aug 08, 2006 page 102 of 982 rej09b0054-0500 to switch p14 from being an output pin to being an input pin, we must change the value of p1ddr bit 4 from 1 to 0 (h'f0 h'e0). here, were execute a bclr instruction for ram0. bclr #4, @ram0 p17 p16 p15 p14 p13 p12 p11 p10 i/o output output output output input input input input p1ddr 1 1 1 1 0 0 0 0 ram0 1 1 1 00000 since ram0 can be read and written, when the bit manipulation instruction is executed, only bit 4 in ram0 is cleared. then we write this ram0 value to p1ddr. mov.b @ram0, r0l mov.b r0l, @p1ddr p17 p16 p15 p14 p13 p12 p11 p10 i/o output output output input input input input input p1ddr 1 1 1 00000 ram0 1 1 1 00000 if this procedure is used to write registers that include write-only bits, programs can be written without depending on the type of the instructions used.
section 3 mcu operating modes rev. 5.00 aug 08, 2006 page 103 of 982 rej09b0054-0500 section 3 mcu operating modes 3.1 operating mode selection the lsi supports four operating modes (modes 7 to 4). these operating modes are used to switch the pin functions. the operating mode is determined by the setting of the mode pins (md2 to md0). modes 6 to 4 are external extended modes used to access external memory or peripheral devices. in the external extended modes each area can be specified as an 8-bit or 16-bit address space using the bus controller after program execution starts. in addition, the 16-bit bus mode is used if any of the areas is configured as 16-bit address space. the 8-bit bus mode is used if all areas are configured as 8-bit address space. mode 7 does not use external address space. do not change the mode pin setting during operation. table 3.1 mcu operating mode selection external data bus mcu operating mode md2 md1 md0 cpu operating mode description on-chip rom initial value maximum value 4 100advanced modeon-chip rom disabled, extended mode disabled 16 bits 16 bits 5 101advanced modeon-chip rom disabled, extended mode disabled 8 bits 16 bits 6 110advanced modeon-chip rom enabled, extended mode enabled 8 bits 16 bits 7 111advanced modesingle-chip modee nabled ? ?
section 3 mcu operating modes rev. 5.00 aug 08, 2006 page 104 of 982 rej09b0054-0500 3.2 register descriptions the following registers are related to the operating mode. ? mode control register (mdcr) ? system control register (syscr) 3.2.1 mode control register (mdcr) mdcr is used to monitor the current operating mode of this lsi. bit bit name initial value r/w description 7? 1 ?reserved this bit is always read as 1 and cannot be modified. 6 to 3 ? all 0 ? reserved these bits are always read as 0 and cannot be modified. 2 1 0 mds2 mds1 mds0 ? * ? * ? * r r r mode select 2 to 0 these bits indicate the input levels at pins md2 to md0 (the current operating mode). bits mds2 to mds0 correspond to md2 to md0. mds2 to mds0 are read-only bits and they cannot be written to. the mode pin (md2 to md0) input levels are latched into these bits when mdcr is read. these latches are canceled by a power-on reset, but maintained at manual reset. note: * determined by the md2 to md0 pin settings.
section 3 mcu operating modes rev. 5.00 aug 08, 2006 page 105 of 982 rej09b0054-0500 3.2.2 system control register (syscr) syscr is used to select the interrupt control mode and the detected edge for nmi, select the mres input pin enable or disable, and enables or disables on-chip ram. bit bit name initial value r/w description 7? 0 r/wreserved the write value should always be 0. 6? 0 ?reserved these bits are always read as 0 and cannot be modified. 5 4 intm1 intm0 0 0 r/w r/w these bits select the control mode of the interrupt controller. for details of the interrupt control modes, see section 5.5.1, interrupt control modes and interrupt operation. 00: interrupt control mode 0 (interrupt is controlled by i bit) 01: setting prohibited 10: interrupt control mode 2 (interrupt is controlled by i2 to i0 bits and ipr) 11: setting prohibited 3 nmieg 0 r/w nmi edge select selects the valid edge of the nmi interrupt input. 0: an interrupt is requested at the falling edge of nmi input 1: an interrupt is requested at the rising edge of nmi input 2 mrese 0 r/w manual reset select enables or disables the mres pin input. 0: the mres pin input (manual reset) is disabled 1: the mres pin input (manual reset) is enabled the mres input pin can be used 1? 0 ?reserved these bits are always read as 0 and cannot be modified. 0 rame 1 r/w ram enable enables or disables the on-chip ram. the rame bit is initialized when the reset status is released. 0: on-chip ram is disabled 1: on-chip ram is enabled
section 3 mcu operating modes rev. 5.00 aug 08, 2006 page 106 of 982 rej09b0054-0500 3.3 operating mode descriptions 3.3.1 mode 4 the cpu can access a 16-mbyte address space in advanced mode. the on-chip rom is disabled. pins p13 to p10, and ports a, b, and c function as an address bus, ports d and e function as a data bus, and part of port f carries bus control signals. pins p13 to p11 function as input ports immediately after a reset. pin 10 and ports a and b function as address (a20 to a8) outputs immediately after a reset. address (a23 to a21) output can be enabled or disabled by bits ae3 to ae0 in the pin function control register (pfcr) regardless of the corresponding data direction register (ddr) values. pins for which address output is disabled among pins p13 to p10 and in ports a and b become port outputs when the corresponding ddr bits are set to 1. port c always has an address (a7 to a0) output function. the initial bus mode after a reset is 16 bits, with 16-bit access to all areas. however, note that if 8- bit access is designated by the bus controller for all areas, the bus mode switches to 8 bits. 3.3.2 mode 5 the cpu can access a 16-mbyte address space in advanced mode. the on-chip rom is disabled. pins p13 to p10, and ports a, b, and c function as an address bus, ports d and e function as a data bus, and part of port f carries bus control signals. pins p13 to p11 function as input ports immediately after a reset. pin 10 and ports a and b function as address (a20 to a8) outputs immediately after a reset. address (a23 to a21) output can be enabled or disabled by bits ae3 to ae0 in the pin function control register (pfcr) regardless of the corresponding data direction register (ddr) values. pins for which address output is disabled among pins p13 to p10 and in ports a and b become port outputs when the corresponding ddr bits are set to 1. port c always has an address (a7 to a0) output function. the initial bus mode after a reset is 8 bits, with 8-bit access to all areas. however, note that if 16- bit access is designated by the bus controller for any area, the bus mode switches to 16 bits and port e becomes a data bus.
section 3 mcu operating modes rev. 5.00 aug 08, 2006 page 107 of 982 rej09b0054-0500 3.3.3 mode 6 the cpu can access a 16-mbyte address space in advanced mode. the on-chip rom is enabled. pins p13 to p10, and ports a, b, and c function as input ports immediately after a reset. address (a23 to a8) output can be enabled or disabled by bits ae3 to ae0 in the pin function control register (pfcr) regardless of the corresponding data direction register (ddr) values. pins for which address output is disabled among pins p13 to p10 and in ports a and b become port outputs when the corresponding ddr bits are set to 1. port c is an input port immediately after a reset. addresses a7 to a0 are output by setting the corresponding ddr bits to 1. ports d and e function as a data bus, and part of port f carries data bus signals. the initial bus mode after a reset is 8 bits, with 8-bit access to all areas. however, note that if 16- bit access is designated by the bus controller for any area, the bus mode switches to 16 bits and port e becomes a data bus. 3.3.4 mode 7 the cpu can access a 16-mbyte address space in advanced mode. the on-chip rom is enabled, but external addresses cannot be accessed. all i/o ports are available for use as input-output ports.
section 3 mcu operating modes rev. 5.00 aug 08, 2006 page 108 of 982 rej09b0054-0500 3.3.5 pin functions the pin functions of ports 1, and a to f vary depending on the operating mode. table 3.2 shows their functions in each operating mode. table 3.2 pin functions in each operating mode port mode 4 mode 5 mode 6 mode 7 port 1 p13 to p11 p * /a p * /a p * /a p p10 p/a * p/a * p * /a p port a pa3 to pa0 p/a * p/a * p * /a p port b p/a * p/a * p * /a p port c a a p * /a p port d dddp port e p/d * p * /d p * /d p port f pf7 p/c * p/c * p/c * p * /c pf6 to pf4 c c c p pf3 p/c * p * /c p * /c p pf2 to pf0 p * /c p * /c p * /c p legend: p: i/o port a: address bus output d: data bus i/o c: control signals, clock i/o * : after reset
section 3 mcu operating modes rev. 5.00 aug 08, 2006 page 109 of 982 rej09b0054-0500 3.4 memory map in each operating mode figures 3.1 to 3.9 show the memory map in each operating mode. modes 4 and 5 (advanced extended modes with on-chip rom disabled) mode 6 (advanced extended mode with on-chip rom enabled) mode 7 (advanced single-chip mode) external address space note: * extermal addresses can be accessed by clearing the rame bit in syscr to 0. external address space internal i/o registers on-chip ram * external address space external address space external address space on-chip ram * on-chip ram * on-chip rom on-chip rom internal i/o registers internal i/o registers internal i/o registers on-chip ram * external address space on-chip ram internal i/o registers internal i/o registers on-chip ram h'000000 h'ffb000 h'ffefc0 h'040000 h'000000 h'03ffff h'000000 h'ffb000 h'ffefbf h'ffff40 h'ffff60 h'ffffc0 h'ffffff h'fff800 h'ffb000 h'ffefc0 h'ffff40 h'ffff60 h'ffff60 h'ffffc0 h'ffffff h'fff800 h'ffff3f h'ffffff h'fff800 h'ffffc0 figure 3.1 h8s/2258 memory map in each operating mode
section 3 mcu operating modes rev. 5.00 aug 08, 2006 page 110 of 982 rej09b0054-0500 modes 4 and 5 (advanced extended modes with on-chip rom disabled) mode 6 (advanced extended mode with on-chip rom enabled) mode 7 (advanced single-chip mode) external address space note: * extermal addresses can be accessed by clearing the rame bit in syscr to 0. external address space external address space on-chip ram * internal i/o registers reserved * on-chip ram * external address space external address space on-chip rom on-chip ram * internal i/o registers reserved * external address space reserved on-chip ram * on-chip rom on-chip ram internal i/o registers internal i/o registers internal i/o registers internal i/o registers on-chip ram h'000000 h'ffb000 h'ffefc0 h'040000 h'020000 h'000000 h'01ffff h'000000 h'ffd000 h'ffd000 h'ffd000 h'ffefbf h'ffff40 h'ffff60 h'ffffc0 h'ffffff h'fff800 h'ffb000 h'ffefc0 h'ffff40 h'ffff60 h'ffff60 h'ffffc0 h'ffffff h'fff800 h'ffff3f h'ffffff h'fff800 h'ffffc0 figure 3.2 h8s/2256 memory map in each operating mode
section 3 mcu operating modes rev. 5.00 aug 08, 2006 page 111 of 982 rej09b0054-0500 modes 4 and 5 (advanced extended modes with on-chip rom disabled) mode 6 (advanced extended mode with on-chip rom enabled) mode 7 (advanced single-chip mode) external address space note: * extermal addresses can be accessed by clearing the rame bit in syscr to 0. internal i/o registers internal i/o registers external address space external address space external address space on-chip ram * on-chip ram * on-chip rom on-chip rom internal i/o registers internal i/o registers on-chip ram * external address space external address space on-chip ram on-chip ram * internal i/o registers internal i/o registers on-chip ram h'000000 h'ff7000 h'ffefc0 h'060000 h'000000 h'05ffff h'000000 h'ff7000 h'ffefbf h'ffff40 h'ffff60 h'ffffc0 h'ffffff h'fff800 h'ff7000 h'ffefc0 h'ffff40 h'ffff60 h'ffff60 h'ffffc0 h'ffffff h'fff800 h'ffff3f h'ffffff h'fff800 h'ffffc0 figure 3.3 h8s/2239 memory map in each operating mode
section 3 mcu operating modes rev. 5.00 aug 08, 2006 page 112 of 982 rej09b0054-0500 modes 4 and 5 (advanced extended modes with on-chip rom disabled) mode 6 (advanced extended mode with on-chip rom enabled) mode 7 (advanced single-chip mode) external address space note: * extermal addresses can be accessed by clearing the rame bit in syscr to 0. external address space internal i/o registers on-chip ram * external address space external address space external address space on-chip ram * on-chip ram * on-chip rom on-chip rom internal i/o registers internal i/o registers internal i/o registers on-chip ram * external address space on-chip ram internal i/o registers internal i/o registers on-chip ram h'000000 h'ffb000 h'ffefc0 h'040000 h'000000 h'03ffff h'000000 h'ffb000 h'ffefbf h'ffff40 h'ffff60 h'ffffc0 h'ffffff h'fff800 h'ffb000 h'ffefc0 h'ffff40 h'ffff60 h'ffff60 h'ffffc0 h'ffffff h'fff800 h'ffff3f h'ffffff h'fff800 h'ffffc0 figure 3.4 h8s/2238b and h8s/2238r memory map in each operating mode
section 3 mcu operating modes rev. 5.00 aug 08, 2006 page 113 of 982 rej09b0054-0500 modes 4 and 5 (advanced extended modes with on-chip rom disabled) mode 6 (advanced extended mode with on-chip rom enabled) mode 7 (advanced single-chip mode) external address space note: * extermal addresses can be accessed by clearing the rame bit in syscr to 0. external address space external address space on-chip ram * internal i/o registers reserved * on-chip ram * external address space external address space on-chip rom on-chip ram * internal i/o registers reserved * external address space reserved on-chip ram * on-chip rom on-chip ram internal i/o registers internal i/o registers internal i/o registers internal i/o registers on-chip ram h'000000 h'ffb000 h'ffefc0 h'040000 h'020000 h'000000 h'01ffff h'000000 h'ffd000 h'ffd000 h'ffd000 h'ffefbf h'ffff40 h'ffff60 h'ffffc0 h'ffffff h'fff800 h'ffb000 h'ffefc0 h'ffff40 h'ffff60 h'ffff60 h'ffffc0 h'ffffff h'fff800 h'ffff3f h'ffffff h'fff800 h'ffffc0 figure 3.5 h8s/2236b and h8s/2236r memory map in each operating mode
section 3 mcu operating modes rev. 5.00 aug 08, 2006 page 114 of 982 rej09b0054-0500 h'000000 h'ffb000 h'ffefc0 h'020000 h'000000 h'01ffff h'000000 h'ffb000 h'ffefbf h'ffff40 h'ffff60 h'ffffc0 h'ffffff h'fff800 h'ffb000 h'ffefc0 h'ffff40 h'ffff60 h'ffff60 h'ffffc0 h'ffffff h'fff800 h'ffff3f h'ffffff h'fff800 h'ffffc0 modes 4 and 5 (advanced extended modes with on-chip rom disabled) mode 6 (advanced extended mode with on-chip rom enabled) mode 7 (advanced single-chip mode) external address space note: * extermal addresses can be accessed by clearing the rame bit in syscr to 0. external address space external address space on-chip ram * internal i/o registers on-chip ram * external address space external address space on-chip rom on-chip ram * internal i/o registers external address space on-chip ram * on-chip rom on-chip ram internal i/o registers internal i/o registers internal i/o registers internal i/o registers on-chip ram figure 3.6 h8s/2237 and h8s/2227 memory map in each operating mode
section 3 mcu operating modes rev. 5.00 aug 08, 2006 page 115 of 982 rej09b0054-0500 h'000000 h'ffb000 h'ffefc0 h'020000 h'000000 h'01ffff h'000000 h'ffe000 h'ffe000 h'ffe000 h'ffefbf h'ffff40 h'ffff60 h'ffffc0 h'ffffff h'fff800 h'ffb000 h'ffefc0 h'ffff40 h'ffff60 h'ffff60 h'ffffc0 h'ffffff h'fff800 h'ffff3f h'ffffff h'fff800 h'ffffc0 modes 4 and 5 (advanced extended modes with on-chip rom disabled) mode 6 (advanced extended mode with on-chip rom enabled) mode 7 (advanced single-chip mode) exter nal address space note: * extermal addresses can be accessed by clearing the rame bit in syscr to 0. external address space external address space on-chip ram * internal i/o registers reserved * on-chip ram * external address space external address space on-chip rom on-chip ram * internal i/o registers reserved * external address space on-chip ram * on-chip rom on-chip ram internal i/o registers internal i/o registers internal i/o registers internal i/o registers on-chip ram figure 3.7 h8s/2235 and h8s/2225 memory map in each operating mode
section 3 mcu operating modes rev. 5.00 aug 08, 2006 page 116 of 982 rej09b0054-0500 reserved * reserved * reserved h'000000 h'ffb000 h'ffefc0 h'020000 h'018000 h'000000 h'017fff h'000000 h'ffe000 h'ffe000 h'ffe000 h'ffefbf h'ffff40 h'ffff60 h'ffffc0 h'ffffff h'fff800 h'ffb000 h'ffefc0 h'ffff40 h'ffff60 h'ffff60 h'ffffc0 h'ffffff h'fff800 h'ffff3f h'ffffff h'fff800 h'ffffc0 modes 4 and 5 (advanced extended modes with on-chip rom disabled) mode 6 (advanced extended mode with on-chip rom enabled) mode 7 (advanced single-chip mode) external address space note: * extermal addresses can be accessed by clearing the rame bit in syscr to 0. external address space external address space on-chip ram * internal i/o registers on-chip ram * external address space external address space on-chip rom on-chip ram * internal i/o registers external address space on-chip ram * on-chip rom on-chip ram internal i/o registers intermal i/o registers internal i/o registers internal i/o registers on-chip ram figure 3.8 h8s/2224 memory map in each operating mode
section 3 mcu operating modes rev. 5.00 aug 08, 2006 page 117 of 982 rej09b0054-0500 h'000000 h'ffb000 h'ffefc0 h'020000 h'010000 h'000000 h'00ffff h'000000 h'ffe000 h'ffe000 h'ffe000 h'ffefbf h'ffff40 h'ffff60 h'ffffc0 h'ffffff h'fff800 h'ffb000 h'ffefc0 h'ffff40 h'ffff60 h'ffff60 h'ffffc0 h'ffffff h'fff800 h'ffff3f h'ffffff h'fff800 h'ffffc0 reserved * reserved * reserved modes 4 and 5 (advanced extended modes with on-chip rom disabled) mode 6 (advanced extended mode with on-chip rom enabled) mode 7 (advanced single-chip mode) external address space note: * extermal addresses can be accessed by clearing the rame bit in syscr to 0. external address space external address space on-chip ram * internal i/o registers on-chip ram * external address space external address space on-chip rom on-chip ram * internal i/o registers external address space on-chip ram * on-chip rom on-chip ram internal i/o registers internal i/o registers internal i/o registers internal i/o registers on-chip ram figure 3.9 h8s/2233 and h8s/2223 memory map in each operating mode
section 3 mcu operating modes rev. 5.00 aug 08, 2006 page 118 of 982 rej09b0054-0500
section 4 exception handling rev. 5.00 aug 08, 2006 page 119 of 982 rej09b0054-0500 section 4 exception handling 4.1 exception handling types and priority as table 4.1 indicates, exception handling may be caused by a reset, trace, trap instruction, or interrupt. exception handling is prioritized as shown in table 4.1. if two or more exceptions occur simultaneously, they are accepted and processed in order of priority. trap instruction exception handling requests are accepted at all times in program execution state. exception sources, the stack structure, and operation of the cpu vary depending on the interrupt control mode set by the intm1 and intm0 bits in syscr. table 4.1 exception types and priority priority exception type start of exception handling high reset starts immediately after a low-to-high transition at the res or mres pin, or when the watchdog timer overflows. the cpu enters the power-on reset state when the res pin is low. the cpu enters the manual reset state when the mres pin is low. trace starts when execution of the current instruction or exception handling ends, if the trace (t) bit in the exr is set to 1. traces are enabled only in interrupt control mode 2. trace exception handling is not executed after execution of an rte instruction. interrupt starts when execution of the current instruction or exception handling ends, if an interrupt request has been issued. interrupt detection is not performed on completion of andc, orc, xorc, or ldc instruction execution, or on completion of reset exception handling. low trap instruction (trapa) started by execution of a trap instruction (trapa). trap instruction exception handling requests are accepted at all times in program execution state. 4.2 exception sources and exception vector table different vector addresses are assigned to different exception sources. table 4.2 lists the exception sources and their vector addresses.
section 4 exception handling rev. 5.00 aug 08, 2006 page 120 of 982 rej09b0054-0500 table 4.2 exce p tion handling vector table exception source vector number vector address advanced mode * 1 power-on reset 0 h'0000 to h'0003 manual reset 1 h'0004 to h'0007 reserved for system use 2 h'0008 to h'000b 3 h'000c to h'000f 4 h'0010 to h'0013 trace 5 h'0014 to h'0017 direct transitions * 3 6 h'0018 to h'001b external interrupt (nmi) 7 h'001c to h'001f trap instruction (four sources) 8 h'0020 to h'0023 9 h'0024 to h'0027 10 h'0028 to h'002b 11 h'002c to h'002f reserved for system use 12 h'0030 to h'0033 13 h'0034 to h'0037 14 h'0038 to h'003b 15 h'003c to h'003f external interrupt irq0 16 h'0040 to h'0043 irq1 17 h'0044 to h'0047 irq2 18 h'0048 to h'004b irq3 19 h'004c to h'004f irq4 20 h'0050 to h'0053 irq5 21 h'0054 to h'0057 irq6 22 h'0058 to h'005b irq7 23 h'005c to h'005f internal interrupt * 2 24 ? 123 h'0060 to h'0063 ? h'01ec to h'01ef notes: 1. lower 16 bits of the address. 2. for details of internal interrupt vectors, see section 5.4.3, interrupt exception handling vector table. 3. for details on direct transitions, see section 24.10, direct transitions.
section 4 exception handling rev. 5.00 aug 08, 2006 page 121 of 982 rej09b0054-0500 4.3 reset a reset has the highest exception priority. when the res or mres pin goes low, all processing halts and this lsi enters the reset. a reset initializes the internal state of the cpu and the registers of on-chip peripheral modules. the interrupt control mode is 0 immediately after reset. when the res or mres pin goes high from the low state, this lsi starts reset exception handling. the chip can also be reset by overflow of the watchdog timer. for details see section 13, watchdog timer (wdt). 4.3.1 reset types the power-on reset and the manual reset are available as the reset. table 4.3 lists the reset types. when the power is supplied, select the power-on reset. both the power-on reset and the manual reset initialize the internal state of the cpu. the power- on reset initializes all registers in on-chip peripheral modules. the manual reset initializes the registers in on-chip peripheral modules except the bus controller and the i/o ports. the state of the bus controller and the i/o ports are maintained. at the manual reset, the on-chip peripheral modules are initialized. thus, the ports that are used as i/o pins for the on-chip peripheral modules are changed to the ports controlled by the ddr and the dr. table 4.3 reset types condition to enter reset internal state reset mres mres mres mres res res res res cpu internal peripheral modules power-on reset low initialized initialized manual reset low high initialized initialized except the bus controller and the i/o ports legend: :don?t care the power-on reset and the manual reset are also available for the reset by the watchdog timer. to enable the mres pin, set the mrese bit in syscr to 1.
section 4 exception handling rev. 5.00 aug 08, 2006 page 122 of 982 rej09b0054-0500 4.3.2 reset exception handling when the res or mres pin goes low, this lsi enters the reset. to ensure that this lsi is reset, hold the res pin low for at least 20 ms at power-up. to reset the chip during operation, hold the res or mres pin low for at least 20 states. when the res or mres pin goes high after being held low for the necessary time, this lsi starts reset exception handling as follows. 1. the internal state of the cpu and the registers of the on-chip peripheral modules are initialized, the t bit in exr is cleared to 0, and the i bits in exr and ccr are set to 1. 2. the reset exception handling vector address is read and transferred to the pc, and program execution starts from the address indicated by the pc. figures 4.1 shows an example of the reset sequence. * * * res , mres high vector fetch internal processing prefetch of first program instruction (1)(3) reset exception handling vector address (at power on reset, (1) = h'000000, (3) = h'000002, at manual reset, (1) = h'000004, (3) = h'000006) (2)(4) start address (contents of reset exception handling vector address) (5) start address ((5) = (2) (4)) (6) first program instruction address bus rd hwr , lwr d15 to d0 (1) (2) (4) (6) (3) (5) note: * three states are inserted for waiting. figure 4.1 reset sequence (mode 4)
section 4 exception handling rev. 5.00 aug 08, 2006 page 123 of 982 rej09b0054-0500 4.3.3 interrupts after reset if an interrupt is accepted after a reset and before the stack pointer (sp) is initialized, the pc and ccr will not be saved correctly, leading to a program crash. to prevent this, all interrupt requests, including nmi, are disabled immediately after a reset. since the first instruction of a program is always executed immediately after the reset state ends, make sure that this instruction initializes the stack pointer (example: mov.l #xx,sp). 4.3.4 state of on-chip peripheral modules after reset release after reset release, mstpcra is initialized to h'3f, mstpcrb and mstpcrc are initialized to h'ff, and all modules except the dmac* and dtc enter module stop mode. consequently, on- chip peripheral module registers cannot be read or written to. register reading and writing is enabled when the module stop mode is exited. note: * supported only by the h8s/2239 group. 4.4 traces traces are enabled in interrupt control mode 2. trace mode is not activated in interrupt control mode 0, irrespective of the state of the t bit. for details of interrupt control modes, see section 5, interrupt controller. if the t bit in exr is set to 1, trace mode is activated. in trace mode, a trace exception occurs on completion of each instruction. trace mode is not affected by interrupt masking. table 4.4 shows the state of ccr and exr after execution of trace exception handling. trace mode is canceled by clearing the t bit in exr to 0. interrupts are accepted even within the trace exception handling routine. the t bit saved on the stack retains its value of 1, and when control is returned from the trace exception handling routine by the rte instruction, trace mode resumes. trace exception handling is not carried out after execution of the rte instruction.
section 4 exception handling rev. 5.00 aug 08, 2006 page 124 of 982 rej09b0054-0500 table 4.4 status of ccr and exr after trace exception handling ccr exr interrupt control mode i ui i2 to i0 t 0 trace exception handling cannot be used. 21??0 legend: 1: set to 1 0: cleared to 0 ?: retains value prior to execution 4.5 interrupts interrupts are controlled by the interrupt controller. the interrupt control has two interrupt control modes and can assign interrupts other than nmi to eight priority/mask levels to enable multiplexed interrupt control. for details, refer to section 5, interrupt controller. interrupt exception handling is conducted as follows: 1. the values in the program counter (pc), condition code register (ccr), and extended control register (exr) are saved to the stack. 2. the interrupt mask bit is updated and the t bit is cleared to 0. 3. a vector address corresponding to the interrupt source is generated, the start address is loaded from the vector table to the pc, and program execution begins from that address. 4.6 trap instruction trap instruction exception handling starts when a trapa instruction is executed. trap instruction exception handling can be executed at all times in the program execution state. trap instruction exception handling is conducted as follows: 1. the values in the program counter (pc), condition code register (ccr), and extended control register (exr) are saved to the stack. 2. the interrupt mask bit is updated and the t bit is cleared to 0. 3. a vector address corresponding to the interrupt source is generated, the start address is loaded from the vector table to the pc, and program execution starts from that address. the trapa instruction fetches a start address from a vector table entry corresponding to a vector number from 0 to 3, as specified in the instruction code.
section 4 exception handling rev. 5.00 aug 08, 2006 page 125 of 982 rej09b0054-0500 table 4.5 shows the status of ccr and exr after execution of trap instruction exception handling. table 4.5 status of ccr and exr after trap instruction exception handling ccr exr interrupt control mode i ui i2 to i0 t 01??? 21??0 legend: 1: set to 1 0: cleared to 0 ?: retains value prior to execution 4.7 stack status after exception handling figures 4.2 shows the stack after completion of trap instruction exception handling and interrupt exception handling. ccr ccr pc (24 bits) sp note: * ignored on return exr pc (24 bits) sp (a) interrupt control mode 0 (b) interrupt control mode 2 reserved * figure 4.2 stack status after exception handling (advanced mode)
section 4 exception handling rev. 5.00 aug 08, 2006 page 126 of 982 rej09b0054-0500 4.8 usage note when accessing word data or longword data, this lsi assumes that the lowest address bit is 0. the stack should always be accessed by word transfer instruction or longword transfer instruction, and the value of the stack pointer (sp, er7) should always be kept even. use the following instructions to save registers: push.w rn (or mov.w rn, @-sp) push.l ern (or mov.l ern, @-sp) use the following instructions to restore registers: pop.w rn (or mov.w @sp+, rn) pop.l ern (or mov.l @sp+, ern) setting sp to an odd value may lead to a malfunction. figure 4.3 shows an example of what happens when the sp value is odd. sp h'fffefa h'fffefb h'fffefc h'fffefd h'fffeff r1l pc sp ccr pc sp ccr: pc: r1l: sp: condition code register program counter general register r1l stack pointer trap instruction executed sp set to h'fffeff data saved above sp mov.b r1l, @-er7 executed contents of ccr lost legend: note: this dia g ram illustrates an example in which the interrupt control mode is 0, in advanced mode. figure 4.3 operation when sp value is odd
section 5 interrupt controller rev. 5.00 aug 08, 2006 page 127 of 982 rej09b0054-0500 section 5 interrupt controller 5.1 features this lsi controls interrupts with the interrupt controller. the interrupt controller has the following features: ? two interrupt control modes ? any of two interrupt control modes can be set by means of the intm1 and intm0 bits in the system control register (syscr). ? priorities settable with ipr ? an interrupt priority register (ipr) is provided for setting interrupt priorities. eight priority levels can be set for each module for all interrupts except nmi. nmi is assigned the highest priority level of 8, also accepted (using nesting) during interrupt processing. additionally accepted during state 12 if opcode = h'57f3. ? independent vector addresses ? all interrupt sources are assigned independent vector addresses, making it unnecessary for the source to be identified in the interrupt handling routine. ? nine external interrupts ? nmi is the highest-priority interrupt, and is accepted at all times. rising edge or falling edge can be selected for nmi. falling edge, rising edge, or both edge detection, or level sensing, can be independently selected for irq7 to irq0. ? dtc and dmac* control ? the dtc and dmac* can be activated by an interrupt request. note: * supported only by the h8s/2239 group.
section 5 interrupt controller rev. 5.00 aug 08, 2006 page 128 of 982 rej09b0054-0500 a block diagram of the interrupt controller is shown in figure 5.1. syscr nmi input irq input internal interrupt request swdtend to tei3 nmieg intm1, intm0 nmi input unit irq input unit isr iscr ier ipr interrupt controller priority determination interrupt request vector number i i2 to i0 ccr exr cpu iscr: ier: isr: ipr: syscr: irq sense control register irq enable register irq status register interrupt priority register system control register legend: figure 5.1 block diagram of interrupt controller
section 5 interrupt controller rev. 5.00 aug 08, 2006 page 129 of 982 rej09b0054-0500 5.2 input/output pins table 5.1 summarizes the pins of the interrupt controller. table 5.1 pin configuration name i/o function nmi input nonmaskable external interrupt. rising or falling edge can be selected. irq7 irq6 irq5 irq4 irq3 irq2 irq1 irq0 input input input input input input input input maskable external interrupts. rising, falling, or both edges, or level sensing can be selected. 5.3 register descriptions the interrupt controller has the following registers. for the system control register, see section 3.2.2, system control register (syscr). ? system control register (syscr) ? irq sense control register h (iscrh) ? irq sense control register l (iscrl) ? irq enable register (ier) ? irq status register (isr) ? interrupt priority register a (ipra) ? interrupt priority register b (iprb) ? interrupt priority register c (iprc) ? interrupt priority register d (iprd) ? interrupt priority register e (ipre) ? interrupt priority register f (iprf) ? interrupt priority register g (iprg) ? interrupt priority register h (iprh) ? interrupt priority register i (ipri)
section 5 interrupt controller rev. 5.00 aug 08, 2006 page 130 of 982 rej09b0054-0500 ? interrupt priority register j (iprj) ? interrupt priority register k (iprk) ? interrupt priority register l (iprl) ? interrupt priority register o (ipro) 5.3.1 interrupt priority registers a to l, and o (ipra to iprl, ipro) the ipr registers are thirteen 8-bit readable/writable registers that set priorities (levels 7 to 0) for interrupt sources other than nmi. the correspondence between interrupt sources and ipr settings is shown in table 5.2. setting a value in the range from h'0 to h'7 in the 3-bit groups of bits 0 to 2 and 4 to 6 sets the priority of the corresponding interrupt. bit bit name initial value r/w description 7 ? 0 ? reserved this bit is always read as 0, and cannot be modified. 6 5 4 ipr6 ipr5 ipr4 1 1 1 r/w r/w r/w sets the priority of the corresponding interrupt source 000: priority level 0 (lowest) 001: priority level 1 010: priority level 2 011: priority level 3 100: priority level 4 101: priority level 5 110: priority level 6 111: priority level 7 (highest) 3 ? 0 ? reserved this bit is always read as 0, and cannot be modified. 2 1 0 ipr2 ipr1 ipr0 1 1 1 r/w r/w r/w sets the priority of the corresponding interrupt source. 000: priority level 0 (lowest) 001: priority level 1 010: priority level 2 011: priority level 3 100: priority level 4 101: priority level 5 110: priority level 6 111: priority level 7 (highest)
section 5 interrupt controller rev. 5.00 aug 08, 2006 page 131 of 982 rej09b0054-0500 5.3.2 irq enable register (ier) ier controls the enabling and disabling of interrupt requests irqn (n = 7 to 0). bit bit name initial value r/w description 7 irq7e 0 r/w irq7 enable the irq7 interrupt request is enabled when this bit is 1. 6 irq6e 0 r/w irq6 enable the irq6 interrupt request is enabled when this bit is 1. 5 irq5e 0 r/w irq5 enable the irq5 interrupt request is enabled when this bit is 1. 4 irq4e 0 r/w irq4 enable the irq4 interrupt request is enabled when this bit is 1. 3 irq3e 0 r/w irq3 enable the irq3 interrupt request is enabled when this bit is 1. 2 irq2e 0 r/w irq2 enable the irq2 interrupt request is enabled when this bit is 1. 1 irq1e 0 r/w irq1 enable the irq1 interrupt request is enabled when this bit is 1. 0 irq0e 0 r/w irq0 enable the irq0 interrupt request is enabled when this bit is 1. 5.3.3 irq sense control registers h and l (iscrh and iscrl) the iscr registers select the source that generates an interrupt request at pins irqn (n = 7 to 0). specifiable sources are the falling edge, rising edge, or both edge detection, and level sensing.
section 5 interrupt controller rev. 5.00 aug 08, 2006 page 132 of 982 rej09b0054-0500 bit bit name initial value r/w description 15 14 irq7scb irq7sca 0 0 r/w r/w irq7 sense control b irq7 sense control a 00: interrupt request generated at irq7 input level low 01: interrupt request generated at falling edge of irq7 input 10: interrupt request generated at rising edge of irq7 input 11: interrupt request generated at both falling and rising edges of irq7 input 13 12 irq6scb irq6sca 0 0 r/w r/w irq6 sense control b irq6 sense control a 00: interrupt request generated at irq6 input level low 01: interrupt request generated at falling edge of irq6 input 10: interrupt request generated at rising edge of irq6 input 11: interrupt request generated at both falling and rising edges of irq6 input 11 10 irq5scb irq5sca 0 0 r/w r/w irq5 sense control b irq5 sense control a 00: interrupt request generated at irq5 input level low 01: interrupt request generated at falling edge of irq5 input 10: interrupt request generated at rising edge of irq5 input 11: interrupt request generated at both falling and rising edges of irq5 input 9 8 irq4scb irq4sca 0 0 r/w r/w irq4 sense control b irq4 sense control a 00: interrupt request generated at irq4 input level low 01: interrupt request generated at falling edge of irq4 input 10: interrupt request generated at rising edge of irq4 input 11: interrupt request generated at both falling and rising edges of irq4 input
section 5 interrupt controller rev. 5.00 aug 08, 2006 page 133 of 982 rej09b0054-0500 bit bit name initial value r/w description 7 6 irq3scb irq3sca 0 0 r/w r/w irq3 sense control b irq3 sense control a 00: interrupt request generated at irq3 input level low 01: interrupt request generated at falling edge of irq3 input 10: interrupt request generated at rising edge of irq3 input 11: interrupt request generated at both falling and rising edges of irq3 input 5 4 irq2scb irq2sca 0 0 r/w r/w irq2 sense control b irq2 sense control a 00: interrupt request generated at irq2 input level low 01: interrupt request generated at falling edge of irq2 input 10: interrupt request generated at rising edge of irq2 input 11: interrupt request generated at both falling and rising edges of irq2 input 3 2 irq1scb irq1sca 0 0 r/w r/w irq1 sense control b irq1 sense control a 00: interrupt request generated at irq1 input level low 01: interrupt request generated at falling edge of irq1 input 10: interrupt request generated at rising edge of irq1 input 11: interrupt request generated at both falling and rising edges of irq1 input 1 0 irq0scb irq0sca 0 0 r/w r/w irq0 sense control b irq0 sense control a 00: interrupt request generated at irq0 input level low 01: interrupt request generated at falling edge of irq0 input 10: interrupt request generated at rising edge of irq0 input 11: interrupt request generated at both falling and rising edges of irq0 input
section 5 interrupt controller rev. 5.00 aug 08, 2006 page 134 of 982 rej09b0054-0500 5.3.4 irq status register (isr) isr indicates the status of irqn (n = 7 to 0) interrupt requests. bit bit name initial value r/w description 7 6 5 4 3 2 1 0 irq7f irq6f irq5f irq4f irq3f irq2f irq1f irq0f 0 0 0 0 0 0 0 0 r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * irq7 to irq0 flags indicates the status of irq7 to irq0 interrupt requests. [setting condition] when the interrupt source selected by the iscrh, or iscrl occurs [clearing conditions] ? cleared by reading irqnf flag when irqnf = 1, then writing 0 to irqnf flag ? when interrupt exception handling is executed when low-level detection is set and irqn input is high level ? when irqn interrupt exception handling is executed when falling, rising, or both-edge detection is set ? when the dtc is activated by an irqn interrupt, and the disel bit in mrb of the dtc is cleared to 0 note: * only 0 can be written to this bit to clear the flag.
section 5 interrupt controller rev. 5.00 aug 08, 2006 page 135 of 982 rej09b0054-0500 5.4 interrupt sources 5.4.1 externa l interrupts there are nine external interrupts: nmi and irq7 to irq0. these interrupts can be used to restore this lsi from software standby mode. nmi interrupt: nmi is the highest-priority interrupt, and is always accepted by the cpu regardless of the interrupt control mode or the status of the cpu interrupt mask bits. the nmieg bit in syscr can be used to select whether an interrupt is requested at a rising edge or a falling edge on the nmi pin. irqn interrupts (n = 7 to 0): irqn interrupts are requested by an input signal at irqn pins. irqn interrupts have the following features: ? using iscr, it is possible to select whether an interrupt is generated by a low level, falling edge, rising edge, or both edges, at irqn pins. ? enabling or disabling of irqn interrupt requests can be selected with ier. ? the interrupt priority level can be set with ipr. ? the status of irqn interrupt requests is indicated in isr. isr flags can be cleared to 0 by software. a block diagram of irqn interrupts is shown in figure 5.2. irqne irqnf s r q irqn interrupt request clear signal edge/level detection circuit irqnsca, irqnscb irqn input note: n = 7 to 0 figure 5.2 block diagram of irqn interrupts the set timing for irqnf is shown in figure 5.3.
section 5 interrupt controller rev. 5.00 aug 08, 2006 page 136 of 982 rej09b0054-0500 irqn input pin irqnf note: n = 7 to 0 figure 5.3 set timing for irqnf the detection of irqn interrupts does not depend on whether the relevant pin has been set for input or output. however, when a pin is used as an external interrupt input pin, do not clear the corresponding ddr to 0; and use the pin as an i/o pin for another function. irqnf interrupt request flag is set to 1 when the setting condition is satisfied, regardless of ier settings. accordingly, refer to only necessary flags. 5.4.2 internal interrupts internal interrupts that are requested from the on-chip peripheral modules have the following features. ? for each on-chip peripheral module, there are flags that indicate the interrupt request status, and enable bits that select enabling or disabling of these interrupts, and they are masked independently. if the enable bit is set to 1 for a particular interrupt source, an interrupt request is issued to the interrupt controller. ? the interrupt priority level can be set with ipr. ? tpu and sci interrupt requests can activate the dmac* or dtc. when the dmac* or dtc is activated by the interrupt request, the interrupt control mode and cpu interrupt mask bits are disregarded. note: * supported only by the h8s/2239 group. 5.4.3 interrupt exception handling vector table table 5.2 shows interrupt exception handling sources, vector addresses, and interrupt priorities. for default priorities, the lower the vector number, the higher the priority. priorities among modules can be set by means of the ipr. modules set at the same priority will conform to their default priorities. priorities within a module are fixed.
section 5 interrupt controller rev. 5.00 aug 08, 2006 page 137 of 982 rej09b0054-0500 table 5.2 interrupt sources, vector addresses, and interrupt priorities vector address * 1 interrupt source origin of interrupt source vector number advanced mode ipr * 2 priority nmi 7 h'001c high external pin irq0 16 h'0040 ipra6 to ipra4 irq1 17 h'0044 ipra2 to ipra0 irq2 18 h'0048 iprb6 to iprb4 irq3 19 h'004c irq4 20 h'0050 iprb2 to iprb0 irq5 21 h'0054 irq6 22 h'0058 irq7 23 h'005c iprc6 to iprc4 dtc swdtend (completion of software initiation data transfer) 24 h'0060 iprc2 to iprc0 watchdog timer 0 wovi0 (interval timer 0) 25 h'0064 iprd6 to iprd4 pc break pc break 27 h'006c ipre6 to ipre4 a/d adi (completion of a/d conversion) 28 h'0070 ipre2 to ipre0 watchdog timer 1 wovi1 (interval timer 1) 29 h'0074 ? reserved 30 31 h'0078 h'007c tpu channel 0 tgi0a (tgr0a input capture/compare-match) 32 h'0080 iprf6 to iprf4 tgi0b (tgr0b input capture/compare-match) 33 h'0084 tgi0c (tgr0c input capture/compare-match) 34 h'0088 low
section 5 interrupt controller rev. 5.00 aug 08, 2006 page 138 of 982 rej09b0054-0500 vector address * 1 interrupt source origin of interrupt source vector number advanced mode ipr * 2 priority tpu channel 0 tgi0d (tgr0d input capture/compare-match) 35 h'008c iprf6 to iprf4 high tci0v (overflow 0) 36 h'0090 ? reserved 37 38 39 h'0094 h'0098 h'009c tpu channel 1 tgi1a (tgr1a input capture/compare-match) 40 h'00a0 iprf2 to iprf0 tgi1b (tgr1b input capture/compare-match) 41 h'00a4 tci1v (overflow 1) 42 h'00a8 tci1u (underflow 1) 43 h'00ac tpu channel 2 tgi2a (tgr2a input capture/compare-match) 44 h'00b0 iprg6 to iprg4 tgi2b (tgr2b input capture/compare-match) 45 h'00b4 tci2v (overflow 2) 46 h'00b8 tci2u (underflow 2) 47 h'00bc tpu channel 3 * 3 tgi3a (tgr3a input capture/compare-match) 48 h'00c0 tgi3b (tgr3b input capture/compare-match) 49 h'00c4 tgi3c (tgr3c input capture/compare-match) 50 h'00c8 tgi3d (tgr3d input capture/compare-match) 51 h'00cc iprg2 to iprg0 tci3v (overflow 3) 52 h'00d0 low
section 5 interrupt controller rev. 5.00 aug 08, 2006 page 139 of 982 rej09b0054-0500 vector address * 1 interrupt source origin of interrupt source vector number advanced mode ipr * 2 priority 53 h'00d4 54 h'00d8 ? reserved 55 h'00dc iprg2 to iprg0 high tgi4a (tgr4a input capture/compare-match) 56 h'00e0 tgi4b (tgr4b input capture/compare-match) 57 h'00e4 tci4v (overflow 4) 58 h'00e8 tpu channel 4 * 3 tci4u (underflow 4) 59 h'00ec iprh6 to iprh4 tpu channel 5 * 3 tgi5a (tgr5a input capture/compare-match) 60 h'00f0 iprh2 to iprh0 tgi5b (tgr5b input capture/compare-match) 61 h'00f4 tci5v (overflow 5) 62 h'00f8 tci5u (underflow 5) 63 h'00fc cmia0 (compare-match a0) 64 h'0100 cmib0 (compare-match b0) 65 h'0104 8-bit timer channel 0 ovi0 (overflow 0) 66 h'0108 ipri6 to ipri4 ? reserved 67 h'010c 8-bit timer channel 1 cmia1 (compare-match a1) 68 h'0110 ipri2 to ipri0 cmib1 (compare-match b1) 69 h'0114 ovi1 (overflow 1) 70 h'0118 ? reserved 71 h'011c low
section 5 interrupt controller rev. 5.00 aug 08, 2006 page 140 of 982 rej09b0054-0500 vector address * 1 interrupt source origin of interrupt source vector number advanced mode ipr * 2 priority dmac * 5 dend0a (completion of channel 0/channel 0a transfer) 72 h'0120 iprj6 to iprj4 high dend0b (completion of channel 0b transfer) 73 h'0124 dend1a (completion of channel 1/channel 1a transfer) 74 h'0128 dend1b (completion of channel 1b transfer) 75 h'012c eri0 (receive error 0) 80 h'0140 iprj2 to iprj0 rxi0 (receive completion 0) 81 h'0144 txi0 (transmit data empty 0) 82 h'0148 sci channel 0 tei0 (transmit end 0) 83 h'014c eri1 (receive error 1) 84 h'0150 iprk6 to iprk4 sci channel 1 rxi1 (receive completion 1) 85 h'0154 txi1 (transmit data empty 1) 86 h'0158 tei1 (transmit end 1) 87 h'015c sci channel 2 * 3 eri2 (receive error 2) 88 h'0160 iprk2 to iprk0 rxi2 (receive completion 2) 89 h'0164 txi2 (transmit data empty 2) 90 h'0168 tei2 (transmit end 2) 91 h'016c 8-bit timer channel 2 * 4 cmia2 (compare-match a2) 92 h'0170 iprl6 to iprl4 cmib2 (compare-match b2) 93 h'0174 ovi2 (overflow 2) 94 h'0178 ? reserved 95 h'017c low
section 5 interrupt controller rev. 5.00 aug 08, 2006 page 141 of 982 rej09b0054-0500 vector address * 1 interrupt source origin of interrupt source vector number advanced mode ipr * 2 priority 8-bit timer channel 3 * 4 cmia3 (compare-match a3) 96 h'0180 iprl6 to iprl4 high cmib3 (compare-match b3) 97 h'0184 ovi3 (overflow 3) 98 h'0188 ? reserved 99 h'018c iic channel 0 * 4 (option) iici0 (1-byte transmission/ reception completion) 100 h'0190 reserved 101 h'0194 iprl2 to iprl0 iici1 (1-byte transmission/ reception completion) 102 h'0198 iic channel 1 * 4 (option) reserved 103 h'019c iprl2 to iprl0 ieb * 6 iebsi (receive status) 104 h'01a0 iprm6 to iprm4 ierxi (rxrdy) 105 h'01a4 ietxi (txrdy) 106 h'01a8 tetsi (transmit status) 107 h'01ac eri3 (receive error 3) 120 h'01e0 ipro6 to ipro4 rxi3 (receive completion 3) 121 h'01e4 txi3 (transmit data empty 3) 122 h'01e8 sci channel 3 tei3 (transmit end ) 123 h'01ec low notes: 1. lower 16 bits of the start address. 2. ipr6 to ipr4, and ipr2 to ipr0 bits are reserved, because these bits have no corresponding interruption. these bits are always read as 0 and cannot be modified. 3. not available in the h8s/2227 group. 4. not available in the h8s/2237 group and h8s/2227 group. 5. supported only by the h8s/2239 group. 6. supported only by the h8s/2258 group.
section 5 interrupt controller rev. 5.00 aug 08, 2006 page 142 of 982 rej09b0054-0500 5.5 operation 5.5.1 interrupt control modes and interrupt operation interrupt operations in this lsi differ depending on the interrupt control mode. nmi interrupts are accepted at all times except in the reset state and the hardware standby state. in the case of irq interrupts and on-chip peripheral module interrupts, an enable bit is provided for each interrupt. clearing an enable bit to 0 disables the corresponding interrupt request. interrupt sources for which the enable bits are set to 1 are controlled by the interrupt controller. table 5.3 shows the interrupt control modes. the interrupt controller performs interrupt control according to the interrupt control mode set by the intm1 and intm0 bits in syscr, the priorities set in ipr, and the masking state indicated by the i bit in the cpu?s ccr, and bits i2 to i0 in exr. table 5.3 interrupt control modes syscr interrupt control mode intm1 intm0 priority setting registers interrupt mask bits description 000 ? i interrupt mask control is performed by the i bit. ? 1 ?? setting prohibited 2 1 0 ipr i2 to i0 8-level interrupt mask control is performed by bits i2 to i0. 8 priority levels can be set with ipr. ? 1 ?? setting prohibited
section 5 interrupt controller rev. 5.00 aug 08, 2006 page 143 of 982 rej09b0054-0500 figure 5.4 shows the block diagram of the priority decision circuits. i interrupt acceptance control 8-level mask control default priority determination vector number interrupt control mode 2 ipr interrupt source i2 to i0 interrupt control mode 0 figure 5.4 block diagram of interrupt control operation interrupt acceptance control: in interrupt control mode 0, interrupt acceptance is controlled by the i bit in ccr. table 5.4 shows the interrupts selected in each interrupt control mode. table 5.4 interrupts selected in each interrupt control mode (1) interrupt mask bits interrupt control mode i selected interrupts 0 0 all interrupts 1 nmi interrupts 2 all interrupts legend: : don?t care 8-level control: in interrupt control mode 2, 8-level mask level determination is performed for the selected interrupts in interrupt acceptance control according to the interrupt priority level (ipr).
section 5 interrupt controller rev. 5.00 aug 08, 2006 page 144 of 982 rej09b0054-0500 the interrupt source selected is the interrupt with the highest priority level, and whose priority level set in ipr is higher than the mask level. table 5.5 interrupts selected in each interrupt control mode (2) interrupt control mode selected interrupts 0 all interrupts 2 highest-priority-level (ipr) interrupt whose priority level is greater than the mask level (ipr > i2 to i0). default priority determination: when an interrupt is selected by 8-level control, its priority is determined and a vector number is generated. if the same value is set for ipr, acceptance of multiple interrupts is enabled, and so only the interrupt source with the highest priority according to the preset default priorities is selected and has a vector number generated. interrupt sources with a lower priority than the accepted interrupt source are held pending. table 5.6 shows operations and control signal functions in each interrupt control mode. table 5.6 operations and control signal functions in each interrupt control mode setting interrupt acceptance control 8-level control interrupt control mode intm1 intm0 i i2 to i0 ipr default priority determination t (trace) 000 o im x ?? * 2 o ? 210x ? * 1 o im pr o t legend: o: interrupt operation control performed. x: no operation (all interrupts enabled). im: used as interrupt mask bit. pr: sets priority. ?: not used. notes: 1. set to 1 when interrupt is accepted. 2. keep the initial setting.
section 5 interrupt controller rev. 5.00 aug 08, 2006 page 145 of 982 rej09b0054-0500 5.5.2 interrupt control mode 0 enabling and disabling of irq interrupts, irq interrupts and on-chip peripheral module interrupts can be set by means of the i bit in the cpu?s ccr. interrupts are enabled when the i bit is cleared to 0, and disabled when set to 1. figure 5.5 shows a flowchart of the interrupt acceptance operation in this case. 1. if an interrupt source occurs when the corresponding interrupt enable bit is set to 1, an interrupt request is sent to the interrupt controller. 2. if the i bit is set to 1, only an nmi interrupt is accepted, and other interrupt requests are held pending. if the i bit is cleared, an interrupt request is accepted. 3. interrupt requests are sent to the interrupt controller, the highest-ranked interrupt according to the priority system is accepted, and other interrupt requests are held pending. 4. when the cpu accepts an interrupt request, it starts interrupt exception handling after execution of the current instruction has been completed. 5. the pc and ccr are saved to the stack area by interrupt exception handling. the pc saved on the stack shows the address of the first instruction to be executed after returning from the interrupt handling routine. 6. next, the i bit in ccr is set to 1. this masks all interrupts except nmi. 7. the cpu generates a vector address for the accepted interrupt and starts execution of the interrupt handling routine at the address indicated by the contents of the vector address in the vector table.
section 5 interrupt controller rev. 5.00 aug 08, 2006 page 146 of 982 rej09b0054-0500 yes program execution status interrupt generated nmi irq1 irq0 save pc and ccr i 1 read vector address branch to interrupt handling routine hold pending tei3 yes yes no yes yes yes no no no i = 0 no figure 5.5 flowchart of procedure up to interrupt acceptance in interrupt control mode 0
section 5 interrupt controller rev. 5.00 aug 08, 2006 page 147 of 982 rej09b0054-0500 5.5.3 interrupt control mode 2 eight-level masking is implemented for irq interrupts, and on-chip peripheral module interrupts by comparing the interrupt mask level set by bits i2 to i0 of exr in the cpu with ipr. figure 5.6 shows a flowchart of the interrupt acceptance operation in this case. 1. if an interrupt source occurs when the corresponding interrupt enable bit is set to 1, an interrupt request is sent to the interrupt controller. 2. when interrupt requests are sent to the interrupt controller, the interrupt with the highest priority according to the interrupt priority levels set in ipr is selected, and lower-priority interrupt requests are held pending. if a number of interrupt requests with the same priority are generated at the same time, the interrupt request with the highest priority according to the priority system shown in table 5.2 is selected. 3. next, the priority of the selected interrupt request is compared with the interrupt mask level set in exr. an interrupt request with a priority no higher than the mask level set at that time is held pending, and only an interrupt request with a priority higher than the interrupt mask level is accepted. 4. when the cpu accepts an interrupt request, it starts interrupt exception handling after execution of the current instruction has been completed. 5. the pc, ccr, and exr are saved to the stack area by interrupt exception handling. the pc saved on the stack shows the address of the first instruction to be executed after returning from the interrupt handling routine. 6. the t bit in exr is cleared to 0. the interrupt mask level is rewritten with the priority level of the accepted interrupt. if the accepted interrupt is nmi, the interrupt mask level is set to h'7. 7. the cpu generates a vector address for the accepted interrupt and starts execution of the interrupt handling routine at the address indicated by the contents of the vector address in the vector table.
section 5 interrupt controller rev. 5.00 aug 08, 2006 page 148 of 982 rej09b0054-0500 yes program execution status interrupt generated? nmi level 6 interrupt? mask level 5 or below? level 7 interrupt? mask level 6 or below? save pc, ccr, and exr clear t bit to 0 update mask level read vector address branch to interrupt handling routine hold pending level 1 interrupt? mask level 0? yes yes no yes yes yes no yes yes no no no no no no figure 5.6 flowchart of procedure up to interrupt acceptance in control mode 2 5.5.4 interrupt exception handling sequence figure 5.7 shows the interrupt exception handling sequence. the example shown is for the case where interrupt control mode 0 is set in advanced mode, and the program area and stack area are in on-chip memory.
section 5 interrupt controller rev. 5.00 aug 08, 2006 page 149 of 982 rej09b0054-0500 (14) (12) (10) (6) (4) (2) (1) (5) (7) (9) (13) interrupt service routine instruction prefetch internal operation vector fetch stack instruction prefetch internal operation interrupt acceptance interrupt level determination wait for end of instruction interrupt request signal internal address bus internal read signal internal write signal internal data bus (3) (1) (2) (4) (3) (5) (7) instruction prefetch address (not executed. this is the contents of the saved pc, the return address) instruction code (not executed) instruction prefetch address (not executed) sp-2 sp-4 saved pc and saved ccr vector address interrupt handling routine start address (vector address contents) interrupt handling routine start address ((13) = (10)(12)) first instruction of interrupt handling routine (6) (8) (9) (11) (10) (12) (13) (14) (8) (11) figure 5.7 interrupt exception handling
section 5 interrupt controller rev. 5.00 aug 08, 2006 page 150 of 982 rej09b0054-0500 5.5.5 interrupt response times this lsi is capable of fast word transfer to on-chip memory, has the program area in on-chip rom and the stack area in on-chip ram, enabling high-speed processing. table 5.7 shows interrupt response times?the interval between generation of an interrupt request and execution of the first instruction in the interrupt handling routine. the execution status symbols used in table 5.7 are explained in table 5.8. table 5.7 interrupt response times normal mode * 5 advanced mode no. execution status intm1 = 0 intm1 = 1 intm1 = 0 intm1 = 1 1 interrupt priority determination * 1 33 33 2 number of wait states until executing instruction ends * 2 1 to 19 + 2s i 1 to 19 + 2s i 1 to 19 + 2s i 1 to 19 + 2s i 3 pc, ccr, exr stack save 2s k 3s k 2s k 3s k 4 vector fetch s i s i 2s i 2s i 5 instruction fetch * 3 2s i 2s i 2s i 2s i 6 internal processing * 4 22 22 total (using on-chip memory) 11 to 31 12 to 32 12 to 32 13 to 33 notes: 1. two states in case of internal interrupt. 2. refers to mulxs and divxs instructions. 3. prefetch after interrupt acceptance and interrupt handling routine prefetch. 4. internal processing after interrupt acceptance and internal processing after vector fetch. 5. not available in this lsi.
section 5 interrupt controller rev. 5.00 aug 08, 2006 page 151 of 982 rej09b0054-0500 table 5.8 number of states in interrupt handling routine execution status object of access external device 8 bit bus 16 bit bus symbol internal memory 2-state access 3-state access 2-state access 3-state access instruction fetch s i 1 4 6 + 2 m 2 3 + m branch address read s j stack manipulation s k legend: m: number of wait states in an external device access. 5.5.6 dtc and dmac* activation by interrupt the dtc and dmac* can be started by interrupts. the following settings are required for this operation. 1. interrupt request to the cpu 2. start request to the dtc 3. start request to the dmac* 4. multiple specification of items 1 to 3. see section 8, dma controller (dmac)*, and section 9, data transfer controller (dtc) for more information on the interrupts that can start the dtc and dmac*. figure 5.8 shows the block diagram of the dtc, dmac*, and interrupt controller circuits. note: * supported only by the h8s/2239 group.
section 5 interrupt controller rev. 5.00 aug 08, 2006 page 152 of 982 rej09b0054-0500 dmac * selection circuit dtcer dtvecr control logic determination of priority cpu dtc selection signal irq interrupt internal peripheral function modules stop signal clear signal clear signal interrupt controller i, i2 to i0 interrupt source clear signal interrupt request dtc start request vector number cpu interrupt request vector number swdte clear signal clear signal note: * supported only by the h8s/2239 group. figure 5.8 dtc and dmac* interrupt control (1) interrupt source selection the dmac* startup sources are directly input to each channel. the startup source for each dmac* channel is selected by the dmacr dtf3 to dtf0 bits. whether or not the selected startup source is managed by the dmac* can be selected with the dmabcr dta bit. if the dta bit is set to 1, the interrupt source that has become the dmac* startup source will not be either a dtc startup source or a cpu interrupt source. interrupt sources other than the interrupt managed by the dmac* are selected to be dtc startup sources or cpu interrupt requests by the dtc dtcera to dtcerf dtce bits. after a dtc data transfer, a cpu interrupt can be requested by clearing the dtce bit to 0 by specifying that with the dtc mrb disel bit. note that when the dtc has performed the stipulated number of data transfers and the transfer counter has become 0, the dtce bit can be cleared to 0 and a cpu interrupt can be requested. note: * supported only by the h8s/2239 group.
section 5 interrupt controller rev. 5.00 aug 08, 2006 page 153 of 982 rej09b0054-0500 (2) determination of priority the dtc startup source is selected according to the default priority. this is not influenced by the mask level or the priority level. see section 9.4, location of register information and dtc vector table, for details on these priorities. the startup sources are directly input to each channel in the dmac*. note: * supported only by the h8s/2239 group. (3) operating sequence when the same interrupt is selected as both the dtc startup source and a cpu interrupt source, the dtc data transfer is performed and then the cpu interrupt exception handling is performed. when the same interrupt is selected as both the dmac* startup source and either the dtc startup source or a cpu interrupt source, the operations are performed independently. they are performed according to the operating states and the bus priorities. table 5.9 shows the interrupt source selection and the interrupt source clear control according to the settings of the dmac* dmabcr dta bit, the dtc dtcera to dtcerf dtce bits, and the dtc mrb disel bit. note: * supported only by the h8s/2239 group. table 5.9 interrupt source selection and clear control settings interrupt source selection and clear control dmac * 1 dtc dta dtce disel dmac * 1 dtc cpu 00 * 10 1 1 ** legend: : the corresponding interrupt is used. the interrupt source is cleared. (the cpu must clear the source flag in the interrupt handler.) : the corresponding interrupt is used. the interrupt source is not cleared. : the corresponding interrupt is not used. * : don't care note: 1. supported only by the h8s/2239 group.
section 5 interrupt controller rev. 5.00 aug 08, 2006 page 154 of 982 rej09b0054-0500 (4) usage notes the sci and a/d converter interrupt sources are cleared when the dmac* or dtc reads or writes the stipulated register. this does not depend on the dta, dtce, and disel bits. note: * supported only by the h8s/2239 group. 5.6 usage notes 5.6.1 contention between interrupt generation and disabling when an interrupt enable bit is cleared to 0 to disable interrupt requests, the disabling becomes effective after execution of the instruction. when an interrupt enable bit is cleared to 0 by an instruction such as bclr or mov, and if an interrupt is generated during execution of the instruction, the interrupt concerned will still be enabled on completion of the instruction, and so interrupt exception handling for that interrupt will be executed on completion of the instruction. however, if there is an interrupt request of higher priority than that interrupt, interrupt exception handling will be executed for the higher-priority interrupt, and the lower-priority interrupt will be ignored. the same also applies when an interrupt source flag is cleared to 0. figure 5.9 shows an example in which the cmiea bit in the tcr register of the 8-bit timer is cleared to 0. the above contention will not occur if an enable bit or interrupt source flag is cleared to 0 while the interrupt is masked.
section 5 interrupt controller rev. 5.00 aug 08, 2006 page 155 of 982 rej09b0054-0500 internal address bus internal write signal cmiea cmfa cmia interrupt signal tcr write cycle by cpu cmia exception handling tcr address figure 5.9 contention between interrupt generation and disabling 5.6.2 instructions that disable interrupts the instructions that disable interrupts are ldc, andc, orc, and xorc. after any of these instructions are executed, all interrupts including nmi are disabled and the next instruction is always executed. when the i bit is set by one of these instructions, the new value becomes valid two states after execution of the instruction ends. 5.6.3 when interrupts are disabled there are times when interrupt acceptance is disabled by the interrupt controller. the interrupt controller disables interrupt acceptance for a 3-state period after the cpu has updated the mask level with an ldc, andc, orc, or xorc instruction. 5.6.4 interrupts during execution of eepmov instruction interrupt operation differs between the eepmov.b instruction and the eepmov.w instruction. with the eepmov.b instruction, an interrupt request (including nmi) issued during the transfer is not accepted until the move is completed.
section 5 interrupt controller rev. 5.00 aug 08, 2006 page 156 of 982 rej09b0054-0500 with the eepmov.w instruction, if an interrupt request is issued during the transfer, interrupt exception handling starts at a break in the transfer cycle. the pc value saved on the stack in this case is the address of the next instruction. therefore, if an interrupt is generated during execution of an eepmov.w instruction, the following coding should be used. l1: eepmov.w mov.w r4,r4 bne l1
section 6 pc break controller (pbc) rev. 5.00 aug 08, 2006 page 157 of 982 rej09b0054-0500 section 6 pc break controller (pbc) the pc break controller (pbc) provides functions that simplify program debugging. using these functions, it is easy to create a self-monitoring debugger, enabling programs to be debugged with the chip alone, without using an in-circuit emulator. a block diagram of the pc break controller is shown in figure 6.1. 6.1 features ? two break channels (a and b) ? 24-bit break address ? bit masking possible ? four types of break compare conditions ? instruction fetch ? data read ? data write ? data read/write ? bus master ? either cpu or cpu/dtc can be selected ? the timing of pc break exception handling after the occurrence of a break condition is as follows: ? immediately before execution of the instruction fetched at the set address (instruction fetch) ? immediately after execution of the instruction that accesses data at the set address (data access) ? module stop mode can be set
section 6 pc break controller (pbc) rev. 5.00 aug 08, 2006 page 158 of 982 rej09b0054-0500 output control output control mask control pc break interrupt match signal mask control bara bcra barb bcrb comparator control logic comparator control logic internal address access status match signal figure 6.1 block diagram of pc break controller 6.2 register descriptions the pc break controller has the following registers. ? break address register a (bara) ? break address register b (barb) ? break control register a (bcra) ? break control register b (bcrb) 6.2.1 break address register a (bara) bara is a 32-bit readable/writable register that specifies the channel a break address. bit bit name initial value r/w description 31 to 24 ? undefined ? reserved these bits are read as an undefined value and cannot be modified. 23 to 0 baa23 to baa0 all 0 r/w break address 23 to 0 these bits set the channel a pc break address.
section 6 pc break controller (pbc) rev. 5.00 aug 08, 2006 page 159 of 982 rej09b0054-0500 6.2.2 break address register b (barb) barb is the channel b break address register. the bit configuration is the same as for bara. 6.2.3 break control register a (bcra) bcra controls channel a pc breaks. bit bit name initial value r/w description 7cmfa 0 r/(w) * 1 condition match flag a [setting condition] when a condition set for channel a is satisfied [clearing condition] when 0 is written to cmfa after reading * 2 cmfa = 1 6 cda 0 r/w cpu cycle/dtc cycle select a selects the channel a break condition bus master. 0: cpu 1: cpu, dtc, or dmac * 3 5 4 3 bamra2 bamra1 bamra0 0 0 0 r/w r/w r/w break address mask register a2 to a0 these bits specify which bits of the break address set in bara are to be masked. 000: baa23 to 0 (all bits are unmasked) 001: baa23 to 1 (lowest bit is masked) 010: baa23 to 2 (lower 2 bits are masked) 011: baa23 to 3 (lower 3 bits are masked) 100: baa23 to 4 (lower 4 bits are masked) 101: baa23 to 8 (lower 8 bits are masked) 110: baa23 to 12 (lower 12 bits are masked) 111: baa23 to 16 (lower 16 bits are masked) 2 1 csela1 csela0 0 0 r/w r/w break condition select selects break condition of channel a. 00: instruction fetch 01: data read cycle 10: data write cycle 11: data read/write cycle
section 6 pc break controller (pbc) rev. 5.00 aug 08, 2006 page 160 of 982 rej09b0054-0500 bit bit name initial value r/w description 0 biea 0 r/w break interrupt enable when this bit is 1, the pc break interrupt request of channel a is enabled. notes: 1. only a 0 can be written to this bit to clear the flag. 2. read the state wherein cmfa = 1 twice or more, when the cmfa is polled after inhibiting the pc break interruption. 3. supported only by the h8s/2239 group. 6.2.4 break control register b (bcrb) bcrb is the channel b break control register. the bit configuration is the same as for bcra. 6.3 operation the operation flow from break condition setting to pc break interrupt exception handling is shown in section 6.3.1, pc break interrupt due to instruction fetch, and section 6.3.2, pc break interrupt due to data access, taking the example of channel a. 6.3.1 pc break interrupt due to instruction fetch 1. set the break address in bara. for a pc break caused by an instruction fetch, set the address of the first instruction byte as the break address. 2. set the break conditions in bcra. set bit 6 (cda) to 0 to select the cpu because the bus master must be the cpu for a pc break caused by an instruction fetch. set the address bits to be masked to bits 5 to 3 (bamra2 to 0). set bits 2 and 1 (csela1 and 0) to 00 to specify an instruction fetch as the break condition. set bit 0 (biea) to 1 to enable break interrupts. 3. when the instruction at the set address is fetched, a pc break request is generated immediately before execution of the fetched instruction, and the condition match flag (cmfa) is set. 4. after priority determination by the interrupt controller, pc break interrupt exception handling is started.
section 6 pc break controller (pbc) rev. 5.00 aug 08, 2006 page 161 of 982 rej09b0054-0500 6.3.2 pc break interrupt due to data access 1. set the break address in bara. for a pc break caused by a data access, set the target rom, ram, i/o, or external address space address as the break address. stack operations and branch address reads are included in data accesses. 2. set the break conditions in bcra. select the bus master with bit 6 (cda). set the address bits to be masked to bits 5 to 3 (bamra2 to 0). set bits 2 and 1 (csela1 and 0) to 01, 10, or 11 to specify data access as the break condition. set bit 0 (biea) to 1 to enable break interrupts. 3. after execution of the instruction that performs a data access on the set address, a pc break request is generated and the condition match flag (cmfa) is set. 4. after priority determination by the interrupt controller, pc break interrupt exception handling is started. 6.3.3 notes on pc break interrupt handling ? when a pc break interrupt is generated at the transfer address of an eepmov.b instruction pc break exception handling is executed after all data transfers have been completed and the eepmov.b instruction has ended. ? when a pc break interrupt is generated at a dtc transfer address pc break exception handling is executed after the dtc has completed the specified number of data transfers, or after data for which the disel bit is set to 1 has been transferred. 6.3.4 operation in transitions to power-down modes the operation when a pc break interrupt is set for an instruction fetch at the address after a sleep instruction is shown below. ? when the sleep instruction causes a transition from high-speed (medium-speed) mode to sleep mode, or from subactive mode to subsleep mode: after execution of the sleep instruction, a transition is not made to sleep mode or subsleep mode, and pc break interrupt handling is executed. after execution of pc break interrupt handling, the instruction at the address after the sleep instruction is executed (figure 6.2 (a)). ? when the sleep instruction causes a transition from high speed (medium speed) mode to subactive mode (figure 6.2 (b)). ? when the sleep instruction causes a transition from subactive mode to high speed (medium speed) mode (figure 6.2 (c)).
section 6 pc break controller (pbc) rev. 5.00 aug 08, 2006 page 162 of 982 rej09b0054-0500 ? when the sleep instruction causes a transition to software standby mode or watch mode: after execution of the sleep instruction, a transition is made to the respective mode, and pc break interrupt handling is not executed. however, the cmfa or cmfb flag is set (figure 6.2 (d). sleep instruction execution high-speed (medium-speed) mode sleep instruction execution subactive mode system clock subclock direct transition exception handling pc break exception handling execution of instruction after sleep instruction subclock system clock, oscillation settling time sleep instruction execution transition to respective mode direct transition exception handling pc break exception handling execution of instruction after sleep instruction pc break exception handling execution of instruction after sleep instruction (a) (b) (c) (d) sleep instruction execution figure 6.2 operation in power-down mode transitions 6.3.5 when instruction execution is delayed by one state while the break interrupt enable bit is set to 1, instruction execution is one state later than usual. ? for 1-word branch instructions (bcc d:8, bsr, jsr, jmp, trapa, rte, and rts) in on-chip rom or ram. ? when break interruption by instruction fetch is set, the set address indicates on-chip rom or ram space, and that address is used for data access, the instruction that executes the data access is one state later than in normal operation. ? when break interruption by instruction fetch is set and a break interrupt is generated, if the executing instruction immediately preceding the set instruction has one of the addressing modes shown below, and that address indicates on-chip rom or ram, the instruction will be one state later than in normal operation. addressing modes: @ern, @(d:16,ern), @(d:32,ern), @-ern/ern+, @aa:8, @aa:24, @aa:32, @(d:8,pc), @(d:16,pc), @@aa:8 ? when break interruption by instruction fetch is set and a break interrupt is generated, if the executing instruction immediately preceding the set instruction is nop or sleep, or has #xx,
section 6 pc break controller (pbc) rev. 5.00 aug 08, 2006 page 163 of 982 rej09b0054-0500 rn as its addressing mode, and that instruction is located in on-chip rom or ram, the instruction will be one state later than in normal operation. 6.4 usage notes 6.4.1 module stop mode setting pbc operation can be disabled or enabled using the module stop control register. the initial setting is for pbc operation to be halted. register access is enabled by clearing module stop mode. for details, refer to section 24, power-down modes. 6.4.2 pc break interrupts the pc break interrupt is shared by channels a and b. the channel from which the request was issued must be determined by the interrupt handler. 6.4.3 cmfa and cmfb the cmfa and cmfb flags are not automatically cleared to 0, so 0 must be written to cmfa or cmfb after first reading the flag while it is set to 1. if the flag is left set to 1, another interrupt will be requested after interrupt handling ends. 6.4.4 pc break interrupt when dtc and dmac * is bus master a pc break interrupt generated when the dtc and dmac* is the bus master is accepted after the bus has been transferred to the cpu by the bus controller. note: * supported only by the h8s/2239 group. 6.4.5 pc break set for instruction fetch at address following bsr, jsr, jmp, trapa, rte, and rts instruction even if the instruction at the address following a bsr, jsr, jmp, trapa, rte, or rts instruction is fetched, it is not executed, and so a pc break interrupt is not generated by the instruction fetch at the next address.
section 6 pc break controller (pbc) rev. 5.00 aug 08, 2006 page 164 of 982 rej09b0054-0500 6.4.6 i bit set by ldc, andc, orc, and xorc instruction when the i bit is set by an ldc, andc, orc, and xorc instruction, a pc break interrupt becomes valid two states after the end of the executing instruction. if a pc break interrupt is set for the instruction following one of these instructions, since interrupts, including nmi, are disabled for a 3-state period in the case of ldc, andc, orc, and xor, the next instruction is always executed. for details, see section 5, interrupt controller. 6.4.7 pc break set for instruction fetch at address following bcc instruction when a pc break is set for an instruction fetch at an address following a bcc instruction: a pc break interrupt is generated if the instruction at the next address is executed in accordance with the branch condition, and is not generated if the instruction at the next address is not executed. 6.4.8 pc break set for instruction fetch at branch destination address of bcc instruction a pc break interrupt is generated if the instruction at the branch destination is executed in accordance with the branch condition, and is not generated if the instruction at the branch destination is not executed.
section 7 bus controller rev. 5.00 aug 08, 2006 page 165 of 982 rej09b0054-0500 section 7 bus controller this lsi has a built-in bus controller (bsc) that manages the external address space divided into eight areas. the bus controller also has a bus arbitration function, and controls the operation of the internal bus masters: the cpu, dma controller (dmac)*, and data transfer controller (dtc). note: * supported only by the h8s/2239 group. 7.1 features ? manages external address space in area units ? manages the external space as 8 areas of 2-mbytes ? bus specifications can be set independently for each area ? burst rom interface can be set ? basic bus interface ? chip select ( cs7 to cs0 ) can be output for areas 7 to 0 ? 8-bit access or 16-bit access can be selected for each area ? 2-state access or 3-state access can be selected for each area ? program wait states can be inserted for each area ? burst rom interface ? burst rom interface can be selected for area 0 ? one or two states can be selected for the burst cycle ? idle cycle insertion ? idle cycle can be inserted between consecutive read accesses to different areas ? idle cycle can be inserted before a write access to an external area immediately after a read access to an external area ? bus arbitration ? the on-chip bus arbiter arbitrates bus mastership among cpu, dmac*, and dtc. ? other features ? external bus release function note: * supported only by the h8s/2239 group.
section 7 bus controller rev. 5.00 aug 08, 2006 page 166 of 982 rej09b0054-0500 figure 7.1 shows a block diagram of the bus controller. area decorder bus controller abwcr astcr bcrh bcrl internal address bus external bus control signals chip select signals breq back internal control signals wait controller wcrh wcrl bus mode signal internal data bus bus arbiter dtc bus request signal dtc bus acknowledge signal cpu bus acknowledge signal dmac bus acknowledge signal * dmac bus request signal * cpu bus request signal wait legend: abwcr: astcr: wcrh: wcrl: bcrh: bcrl: note: * supported only by the h8s/2239 group. bus width control register access state control register wait control register h wait control register l bus control register h bus control register l figure 7.1 block diagram of bus controller
section 7 bus controller rev. 5.00 aug 08, 2006 page 167 of 982 rej09b0054-0500 7.2 input/output pins table 7.1 summarizes the pins of the bus controller. table 7.1 pin configuration name symbol i/o function address strove as output strobe signal indicating that address output on address bus is enabled. read rd output strobe signal indicating that external space is being read. high write hwr output strobe signal indicating that external space is to be written, and upper half (d15 to d8) of data bus is enabled. low write lwr output strobe signal indicating that external space is to be written, and lower half (d7 to d0) of data bus is enabled. chip select 7 to 0 cs7 to cs0 output strobe signal indicating that areas 7 to 0 are selected. wait wait input wait request signal when accessing external 3-state access space. bus request breq input request signal that releases bus to external device. bus request acknowledge back output acknowledge signal indicating that bus has been released. 7.3 register descriptions the following shows the registers of the bus controller. ? bus width control register (abwcr) ? access state control register (astcr) ? wait control register h (wcrh) ? wait control register l (wcrl) ? bus control register h (bcrh) ? bus control register l (bcrl ) ? pin function control register (pfcr)
section 7 bus controller rev. 5.00 aug 08, 2006 page 168 of 982 rej09b0054-0500 7.3.1 bus width control register (abwcr) abwcr designates each area for either 8-bit access or 16-bit access. abwcr sets the data bus width for the external memory space. the bus width for on-chip memory and internal i/o registers is fixed regardless of the settings in abwcr. bit bit name initial value r/w description 7 6 5 4 3 2 1 0 abw7 abw6 abw5 abw4 abw3 abw2 abw1 abw0 1/0 * 1/0 * 1/0 * 1/0 * 1/0 * 1/0 * 1/0 * 1/0 * r/w r/w r/w r/w r/w r/w r/w r/w area 7 to 0 bus width control these bits select whether the corresponding area is to be designated for 8-bit access or 16-bit access. 0: area n is designated for 16-bit access 1: area n is designated for 8-bit access note: n = 7 to 0 note: * in modes 5 to 7, initial value of each bit is 1. in mode 4, initial value of each bit is 0. 7.3.2 access state control register (astcr) astcr designates each area as either a 2-state access space or a 3-state access space. astcr sets the number of access states for the external memory space. the number of access states for on-chip memory and internal i/o registers is fixed regardless of the settings in astcr. bit bit name initial value r/w description 7 6 5 4 3 2 1 0 ast7 ast6 ast5 ast4 ast3 ast2 ast1 ast0 1 1 1 1 1 1 1 1 r/w r/w r/w r/w r/w r/w r/w r/w area 7 to 0 access state control these bits select whether the corresponding area is to be designated as a 2-state access space or a 3-state access space. wait state insertion is enabled or disabled at the same time. 0: area n is designated for 2-state access wait state insertion in area n external space is disabled 1: area n is designated for 3-state access wait state insertion in area n external space is enabled note: n = 7 to 0
section 7 bus controller rev. 5.00 aug 08, 2006 page 169 of 982 rej09b0054-0500 7.3.3 wait control registers h and l (wcrh, wcrl) wcrh and wcrl select the number of program wait states for each area. program waits are not inserted in the case of on-chip memory or internal i/o registers. ? wcrh bit bit name initial value r/w description 7 6 w71 w70 1 1 r/w r/w area 7 wait control 1 and 0 these bits select the number of program wait states when area 7 in external space is accessed while the ast7 bit in astcr is set to 1. 00: program wait not inserted when external space area 7 is accessed 01: 1 program wait state inserted when external space area 7 is accessed 10: 2 program wait states inserted when external space area 7 is accessed 11: 3 program wait states inserted when external space area 7 is accessed 5 4 w61 w60 1 1 r/w r/w area 6 wait control 1 and 0 these bits select the number of program wait states when area 6 in external space is accessed while the ast6 bit in astcr is set to 1. 00: program wait not inserted when external space area 6 is accessed 01: 1 program wait state inserted when external space area 6 is accessed 10: 2 program wait states inserted when external space area 6 is accessed 11: 3 program wait states inserted when external space area 6 is accessed
section 7 bus controller rev. 5.00 aug 08, 2006 page 170 of 982 rej09b0054-0500 bit bit name initial value r/w description 3 2 w51 w50 1 1 r/w r/w area 5 wait control 1 and 0 these bits select the number of program wait states when area 5 in external space is accessed while the ast5 bit in astcr is set to 1. 00: program wait not inserted when external space area 5 is accessed 01: 1 program wait state inserted when external space area 5 is accessed 10: 2 program wait states inserted when external space area 5 is accessed 11: 3 program wait states inserted when external space area 5 is accessed 1 0 w41 w40 1 1 r/w r/w area 4 wait control 1 and 0 these bits select the number of program wait states when area 4 in external space is accessed while the ast4 bit in astcr is set to 1. 00: program wait not inserted when external space area 4 is accessed 01: 1 program wait state inserted when external space area 4 is accessed 10: 2 program wait states inserted when external space area 4 is accessed 11: 3 program wait states inserted when external space area 4 is accessed ? wcrl bit bit name initial value r/w description 7 6 w31 w30 1 1 r/w r/w area 3 wait control 1 and 0 these bits select the number of program wait states when area 3 in external space is accessed while the ast3 bit in astcr is set to 1. 00: program wait not inserted when external space area 3 is accessed 01: 1 program wait state inserted when external space area 3 is accessed 10: 2 program wait states inserted when external space area 3 is accessed 11: 3 program wait states inserted when external space area 3 is accessed
section 7 bus controller rev. 5.00 aug 08, 2006 page 171 of 982 rej09b0054-0500 bit bit name initial value r/w description 5 4 w21 w20 1 1 r/w r/w area 2 wait control 1 and 0 these bits select the number of program wait states when area 2 in external space is accessed while the ast2 bit in astcr is set to 1. 00: program wait not inserted when external space area 2 is accessed 01: 1 program wait state inserted when external space area 2 is accessed 10: 2 program wait states inserted when external space area 2 is accessed 11: 3 program wait states inserted when external space area 2 is accessed 3 2 w11 w10 1 1 r/w r/w area 1 wait control 1 and 0 these bits select the number of program wait states when area 1 in external space is accessed while the ast1 bit in astcr is set to 1. 00: program wait not inserted when external space area 1 is accessed 01: 1 program wait state inserted when external space area 1 is accessed 10: 2 program wait states inserted when external space area 1 is accessed 11: 3 program wait states inserted when external space area 1 is accessed 1 0 w01 w00 1 1 r/w r/w area 0 wait control 1 and 0 these bits select the number of program wait states when area 0 in external space is accessed while the ast0 bit in astcr is set to 1. 00: program wait not inserted when external space area 0 is accessed 01: 1 program wait state inserted when external space area 0 is accessed 10: 2 program wait states inserted when external space area 0 is accessed 11: 3 program wait states inserted when external space area 0 is accessed
section 7 bus controller rev. 5.00 aug 08, 2006 page 172 of 982 rej09b0054-0500 7.3.4 bus control register h (bcrh) bcrh selects enabling or disabling of idle cycle insertion, and the memory interface for area 0. bit bit name initial value r/w description 7 icis1 1 r/w idle cycle insert 1 selects whether or not one idle cycle state is to be inserted between bus cycles when successive external read cycles are performed in different areas. 0: idle cycle not inserted in case of successive external read cycles in different areas 1: idle cycle inserted in case of successive external read cycles in different areas 6 icis0 1 r/w idle cycle insert 0 selects whether or not one idle cycle state is to be inserted between bus cycles when successive external read and write cycles are performed. 0: idle cycle not inserted in case of successive external read and write cycles 1: idle cycle inserted in case of successive external read and write cycles 5 brstrm 0 r/w burst rom enable selects whether area 0 is used as a burst rom interface. 0: area 0 is basic bus interface 1: area 0 is burst rom interface 4 brsts1 1 r/w burst cycle select 1 selects the number of burst cycles for the burst rom interface. 0: burst cycle comprises 1 state 1: burst cycle comprises 2 states 3 brsts0 0 r/w burst cycle select 0 selects the number of words that can be accessed in a burst rom interface burst access. 0: max. 4 words in burst access 1: max. 8 words in burst access 2 to 0 ? all 0 r/w reserved the write value should always be 0.
section 7 bus controller rev. 5.00 aug 08, 2006 page 173 of 982 rej09b0054-0500 7.3.5 bus control register l (bcrl) bcrl performs selection of the external bus-released state protocol, and enabling or disabling of wait pin input. bit bit name initial value r/w description 7 brle 0 r/w bus release enable enables or disables external bus release. 0: external bus release is disabled. breq and back can be used as i/o ports 1: external bus release is enabled 6? 0 r/wreserved the write value should always be 0. 5? 0 ? reserved this bit is always read as 0 and cannot be modified. 4? 0 r/wreserved the write value should always be 0. 3? 1 r/wreserved the write value should always be 1. 2, 1 ? all 0 r/w reserved the write value should always be 0. 0 waite 0 r/w wait pin enable selects enabling or disabling of wait input by the wait pin. 0: wait input by wait pin disabled. wait pin can be used as i/o port 1: wait input by wait pin enabled
section 7 bus controller rev. 5.00 aug 08, 2006 page 174 of 982 rej09b0054-0500 7.3.6 pin function control register (pfcr) bit bit name initial value r/w description 7, 6 ? all 0 r/w reserved the write value should always be 0. 5 buzze 0 r/w buzz output enable: this bit selects enabling or disabling of buzz output from pin pf1. wdt_1 input clock that is selected by pss, and cks2 to cks0 bits is output as buzz signal. 0: pf1 input/output pin 1: buzz output pin 4 ? 0r/wreserved the write value should always be 0. 3 2 1 0 ae3 ae2 ae1 ae0 1/0 * 1/0 * 0 1/0 * r/w r/w r/w r/w address output enable 3 to 0 these bits select enabling or disabling of address outputs a23 to a8 in romless extended mode and modes with rom. when a pin is enabled for address output, the address is output regardless of the corresponding ddr setting. when a pin is disabled for address output, it becomes an output port when the corresponding ddr bit is set to 1. 0000: a23 to a8 output disabled 0001: a8 output enabled; a23 to a9 output disabled 0010: a9, a8 output enabled; a23 to a10 output disabled 0011: a10 to a8 output enabled; a23 to a11 output disabled 0100: a11 to a8 output enabled; a23 to a12 output disabled 0101: a12 to a8 output enabled; a23 to a13 output disabled 0110: a13 to a8 output enabled; a23 to a14 output disabled 0111: a14 to a8 output enabled; a23 to a15 output disabled 1000: a15 to a8 output enabled; a23 to a16 output disabled 1001: a16 to a8 output enabled; a23 to a17 output disabled 1010: a17 to a8 output enabled; a23 to a18 output disabled 1011: a18 to a8 output enabled; a23 to a19 output disabled 1100: a19 to a8 output enabled; a23 to a20 output disabled 1101: a20 to a8 output enabled; a23 to a21 output disabled 1110: a21 to a8 output enabled; a23, a22 output disabled 1111: a23 to a8 output enabled note: * in modes 4 and 5, initial value of each bit is 1. in modes 6 and 7, initial value of each bit is 0.
section 7 bus controller rev. 5.00 aug 08, 2006 page 175 of 982 rej09b0054-0500 7.4 bus control 7.4.1 area divisions in advanced mode, the bus controller partitions the 16 mbytes address space into eight areas, 7 to 0, in 2-mbyte units, and performs bus control for external space in area units. in normal mode*, it controls a 64-kbyte address space comprising part of area 0. figure 7.2 shows an outline of the memory map. chip select signals ( cs7 to cs0 ) can be output for each area. note: * not availoable in this lsi. area 0 (2 mbytes) h'000000 h'ffffff (1) (2) h'0000 h'1fffff h'200000 area 1 (2 mbytes) h'3fffff h'400000 area 2 (2 mbytes) h'5fffff h'600000 area 3 (2 mbytes) h'7fffff h'800000 area 4 (2 mbytes) h'9fffff h'a00000 area 5 (2 mbytes) h'bfffff h'c00000 area 6 (2 mbytes) h'dfffff h'e00000 area 7 (2 mbytes) h'ffff advanced mode normal mode * note: * not available in this lsi. figure 7.2 overview of area divisions
section 7 bus controller rev. 5.00 aug 08, 2006 page 176 of 982 rej09b0054-0500 7.4.2 bus specifications the external space bus specifications consist of three elements: bus width, number of access states, and number of program wait states. the bus width and number of access states for on-chip memory and internal i/o registers are fixed, and are not affected by the bus controller. (1) bus width: a bus width of 8 or 16 bits can be selected with abwcr. an area for which an 8-bit bus is selected functions as an 8-bit access space, and an area for which a 16-bit bus is selected functions as a16-bit access space. if all areas are designated for 8-bit access, 8-bit bus mode is set; if any area is designated for 16-bit access, 16-bit bus mode is set. when the burst rom interface is designated, 16-bit bus mode is always set. (2) number of access states: two or three access states can be selected with astcr. an area for which 2-state access is selected functions as a 2-state access space, and an area for which 3-state access is selected functions as a 3-state access space. with the burst rom interface, the number of access states may be determined without regard to astcr. when 2-state access space is designated, wait insertion is disabled. (3) number of program wait states: when 3-state access space is designated by astcr, the number of program wait states to be inserted automatically is selected with wcrh and wcrl. from 0 to 3 program wait states can be selected.
section 7 bus controller rev. 5.00 aug 08, 2006 page 177 of 982 rej09b0054-0500 table 7.2 bus specifications for each area (basic bus interface) abwcr astcr wcrh, wcrl bus specifications (basic bus interface) abwn astn wn1 wn0 bus width number of access states number of program wait states 00 ?? 16 2 0 100 3 0 11 10 2 13 10 ?? 82 0 100 3 0 11 10 2 13 7.4.3 bus interface for each area the initial state of each area is basic bus interface, 3-state access space. the initial bus width is selected according to the operating mode. the bus specifications described here cover basic items only, and the sections on each memory interface (7.6, basic bus interface and 7.7, burst rom interface) should be referred to for further details. (1) area 0: area 0 includes on-chip rom, and in rom-disabled extended mode, all of area 0 is external space. in rom-enabled extended mode, the space excluding on-chip rom is external space. when area 0 external space is accessed, the cs0 signal can be output. either basic bus interface or burst rom interface can be selected for area 0. (2) areas 6 to 1: in external extended mode, all of areas 6 to 1 is external space. when area 6 to 1 external space is accessed, the cs6 to cs1 pin signals respectively can be output. only the basic bus interface can be used for areas 6 to 1. (3) area 7: area 7 includes the on-chip ram and internal l/o registers. in external extended mode, the space excluding the on-chip ram and internal l/o registers, is external space. the on-chip ram is enabled when the rame bit in the system control register (syscr) is set to 1; when the rame bit is cleared to 0, the on-chip ram is disabled and the corresponding space becomes external space. when area 7 external space is accessed, the cs7 signal can be output.
section 7 bus controller rev. 5.00 aug 08, 2006 page 178 of 982 rej09b0054-0500 only the basic bus interface can be used for the area 7. 7.4.4 chip select signals this lsi can output chip select signals ( cs7 to cs0 ) to areas 7 to 0, the signal being driven low when the corresponding external space area is accessed. figure 7.3 shows an example of csn (n = 7 to 0) output timing. enabling or disabling of the csn signal is performed by setting the data direction register (ddr) for the port corresponding to the particular csn pin. in rom-disabled extended mode, the cs0 pin is placed in the output state after a power-on reset. pins cs7 to cs1 are placed in the input state after a power-on reset, and so the corresponding ddr should be set to 1 when outputting signals cs7 to cs1 . in rom-enabled extended mode, pins cs7 to cs0 are all placed in the input state after a power-on reset, and so the corresponding ddr should be set to 1 when outputting signals cs7 to cs0 . for details, see section 10, i/o ports. bus cycle t 1 t 2 t 3 area n external address address bus csn figure 7.3 csn csn csn csn signal output timing (n = 0 to 7) 7.5 basic timing the cpu is driven by a system clock ( ), denoted by the symbol . the period from one rising edge of to the next is referred to as a ?state?. the memory cycle or bus cycle consists of one, two, or three states. different methods are used to access on-chip memory, on-chip peripheral modules, and the external address space.
section 7 bus controller rev. 5.00 aug 08, 2006 page 179 of 982 rej09b0054-0500 7.5.1 on-chip memory (rom, ram) access timing on-chip memory is accessed in one state. the data bus is 16 bits wide, permitting both byte and word transfer instruction. figure 7.4 shows the on-chip memory access cycle. figure 7.5 shows the pin states. t 1 internal address bus bus cycle address read data write data internal read signal internal data bus internal write signal internal data bus read access write access figure 7.4 on-5chip memory access cycle bus cycle t 1 unchanged address bus as rd hwr , lwr data bus high high high high-impedance state figure 7.5 pin states during on-chip memory access
section 7 bus controller rev. 5.00 aug 08, 2006 page 180 of 982 rej09b0054-0500 7.5.2 on-chip peripheral module access timing the on-chip peripheral modules are accessed in two states. the data bus is either 8 bits or 16 bits wide, depending on the particular internal i/o register being accessed. figure 7.6 shows the access timing for the on-chip peripheral modules. figure 7.7 shows the pin states. t 1 t 2 internal address bus bus cycle address read data write data internal read signal internal data bus internal write signal internal data bus read access write access figure 7.6 on-chip peripheral module access cycle t 1 t 2 bus cycle unchanged address bus as rd hwr , lwr data bus high high high high-impedance state figure 7.7 pin states during on-chip peripheral module access
section 7 bus controller rev. 5.00 aug 08, 2006 page 181 of 982 rej09b0054-0500 7.5.3 external address space access timing the external address space is accessed with an 8-bit or 16-bit data bus width in a two-state or three-state bus cycle. in three-state access, wait states can be inserted. for further details, refer to section 7.6.3, basic timing. 7.6 basic bus interface the basic bus interface enables direct connection of rom, sram, and so on. 7.6.1 data size and data alignment data sizes for the cpu and other internal bus masters are byte, word, and longword. the bus controller has a data alignment function, and when accessing external space, controls whether the upper data bus (d15 to d8) or lower data bus (d7 to d0) is used according to the bus specifications for the area being accessed (8-bit access space or 16-bit access space) and the data size. 8-bit access space: figure 7.8 illustrates data alignment control for the 8-bit access space. with the 8-bit access space, the upper data bus (d15 to d8) is always used for accesses. the amount of data that can be accessed at one time is one byte: a word transfer instruction is performed as two- byte accesses, and a longword transfer instruction, as four-byte accesses. upper data bus lower data bus byte size word size 1st bus cycle 2nd bus cycle 1st bus cycle 2nd bus cycle 3rd bus cycle 4th bus cycle longword size ? even address byte size ? odd address d15 d8 d7 d0 figure 7.8 access sizes and data alignment control (8-bit access space) 16-bit access space: figure 7.9 illustrates data alignment control for the 16-bit access space. with the 16-bit access space, the upper data bus (d15 to d8) and lower data bus (d7 to d0) are used for accesses. the amount of data that can be accessed at one time is one byte or one word, and a longword transfer instruction is executed as two word transfer instructions.
section 7 bus controller rev. 5.00 aug 08, 2006 page 182 of 982 rej09b0054-0500 in byte access, whether the upper or lower data bus is used is determined by whether the address is even or odd. the upper data bus is used for an even address, and the lower data bus for an odd address. d15 d8 d7 d0 upper data bus lower data bus byte size word size 1st bus cycle 2nd bus cycle longword size ? even address byte size ? odd address figure 7.9 access sizes and data alignment control (16-bit access space) 7.6.2 valid strobes table 7.3 shows the data buses used and valid strobes for the access spaces. in a read, the rd signal is valid without discrimination between the upper and lower halves of the data bus. in a write, the hwr signal is valid for the upper half of the data bus, and the lwr signal for the lower half. table 7.3 data buses used and valid strobes area access size read/ write address valid strobe upper data bus (d15 to d8) lower data bus (d7 to d0) byte read ? rd valid invalid 8-bit access space write ? hwr hi-z byte read even rd valid invalid odd invalid valid write even hwr valid hi-z odd lwr hi-z valid word read ? rd valid valid 16-bit access space write ? hwr , lwr valid valid notes: hi-z: high impedance. invalid: input state; input value is ignored.
section 7 bus controller rev. 5.00 aug 08, 2006 page 183 of 982 rej09b0054-0500 7.6.3 basic timing 8-bit 2-state access space: figure 7.10 shows the bus timing for an 8-bit 2-state access space. when an 8-bit access space is accessed, the upper half (d15 to d8) of the data bus is used. wait states cannot be inserted. bus cycle t 1 t 2 address bus csn as rd d15 to d8 valid d7 to d0 invalid read hwr lwr (16-bit bus mode) d15 to d8 valid d7 to d0 high impedance high impedance write high note: n = 7 to 0 lwr (8-bit bus mode) figure 7.10 bus timing for 8-bit 2-state access space
section 7 bus controller rev. 5.00 aug 08, 2006 page 184 of 982 rej09b0054-0500 8-bit 3-state access space: figure 7.11 shows the bus timing for an 8-bit 3-state access space. when an 8-bit access space is accessed, the upper half (d15 to d8) of the data bus is used. wait states can be inserted. bus cycle t 1 t 2 address bus csn as rd d15 to d8 valid d7 to d0 invalid read hwr lwr (16-bit bus mode) d15 to d8 valid d7 to d0 write high note: n = 7 to 0 t 3 high impedance high impedance lwr (8-bit bus mode) figure 7.11 bus timing for 8-bit 3-state access space
section 7 bus controller rev. 5.00 aug 08, 2006 page 185 of 982 rej09b0054-0500 16-bit 2-state access space: figures 7.12 to 7.14 show bus timings for a 16-bit 2-state access space. when a 16-bit access space is accessed, the upper half (d15 to d8) of the data bus is used for the even address, and the lower half (d7 to d0) for the odd address. wait states cannot be inserted. bus cycle t 1 t 2 address bus csn as rd d15 to d8 valid d7 to d0 invalid read hwr lwr d15 to d8 valid d7 to d0 write high note: n = 7 to 0 high impedance figure 7.12 bus timing for 16-bit 2-state access space (1) (even address byte access)
section 7 bus controller rev. 5.00 aug 08, 2006 page 186 of 982 rej09b0054-0500 bus cycle t 1 t 2 address bus csn as rd d15 to d8 invalid d7 to d0 valid read hwr lwr d15 to d8 d7 to d0 valid write note: n = 7 to 0 high high impedance figure 7.13 bus timing for 16-bit 2-state access space (2) (odd address byte access)
section 7 bus controller rev. 5.00 aug 08, 2006 page 187 of 982 rej09b0054-0500 bus cycle t 1 t 2 address bus csn as rd d15 to d8 valid d7 to d0 valid read hwr lwr d15 to d8 valid d7 to d0 valid write note: n = 7 to 0 figure 7.14 bus timing for 16-bit 2-state access space (3) (word access)
section 7 bus controller rev. 5.00 aug 08, 2006 page 188 of 982 rej09b0054-0500 16-bit 3-state access space: figures 7.15 to 7.17 show bus timings for a 16-bit 3-state access space. when a 16-bit access space is accessed , the upper half (d15 to d8) of the data bus is used for the even address, and the lower half (d7 to d0) for the odd address. wait states can be inserted. bus cycle t 1 t 2 address bus csn as rd d15 to d8 valid d7 to d0 invalid read hwr lwr d15 to d8 valid d7 to d0 write high note: n = 7 to 0 t 3 high impedance figure 7.15 bus timing for 16-bit 3-state access space (1) (even address byte access)
section 7 bus controller rev. 5.00 aug 08, 2006 page 189 of 982 rej09b0054-0500 bus cycle t 1 t 2 address bus csn as rd d15 to d8 invalid d7 to d0 valid read hwr lwr d15 to d8 d7 to d0 valid write high note: n = 7 to 0 t 3 high impedance figure 7.16 bus timing for 16-bit 3-state access space (2) (odd address byte access)
section 7 bus controller rev. 5.00 aug 08, 2006 page 190 of 982 rej09b0054-0500 bus cycle t 1 t 2 address bus csn as rd d15 to d8 valid d7 to d0 valid read hwr lwr d15 to d8 valid d7 to d0 valid write note: n = 7 to 0 t 3 figure 7.17 bus timing for 16-bit 3-state access space (3) (word access) 7.6.4 wait control when accessing external space, this lsi can extend the bus cycle by inserting one or more wait states (tw). there are two ways of inserting wait states: program wait insertion and pin wait insertion using the wait pin. (1) program wait insertion from 0 to 3 wait states can be inserted automatically between the t 2 state and t 3 state on an individual area basis in 3-state access space, according to the settings of wcrh and wcrl.
section 7 bus controller rev. 5.00 aug 08, 2006 page 191 of 982 rej09b0054-0500 (2) pin wait insertion setting the waite bit in bcrh to 1 enables wait insertion by means of the wait pin. when external space is accessed in this state, program wait insertion is first carried out according to the settings in wcrh and wcrl. then, if the wait pin is low at the falling edge of in the last t 2 or t w state, a t w state is inserted. if the wait pin is held low, t w states are inserted until it goes high. figure 7.18 shows an example of wait state insertion timing. by program wait t 1 address bus as rd data bus read data read hwr , lwr write data write note: indicates the timing of wait pin sampling. wait data bus t 2 t w t w t w t 3 by wait pin figure 7.18 example of wait state insertion timing
section 7 bus controller rev. 5.00 aug 08, 2006 page 192 of 982 rej09b0054-0500 7.7 burst rom interface with this lsi, external space area 0 can be designated as burst rom space, and burst rom interfacing can be performed. the burst rom space interface enables 16-bit configuration rom with burst access capability to be accessed at high speed. area 0 can be designated as burst rom space by means of the brstrm bit in bcrh. consecutive burst accesses of a maximum of 4 words or 8 words can be performed for cpu instruction fetches only. one or two states can be selected for burst access. note: when the operating frequency ranges from 16 mhz to 20 mhz, the burst rom interface is not available. 7.7.1 basic timing the number of states in the initial cycle (full access) of the burst rom interface is in accordance with the setting of the ast0 bit in astcr. also, when the ast0 bit is set to 1, wait state insertion is possible. one or two states can be selected for the burst cycle, according to the setting of the brsts1 bit in bcrh. wait states cannot be inserted. when area 0 is designated as burst rom space, it becomes 16-bit access space regardless of the setting of the abw0 bit in abwcr. when the brsts0 bit in bcrh is cleared to 0, burst access of up to 4 words is performed; when the brsts0 bit is set to 1, burst access of up to 8 words is performed. the basic access timing for burst rom space is shown in figures 7.19 and 7.20. the timing shown in figure 7.19 is for the case where the ast0 and brsts1 bits are both set to 1, and that in figure 7.20 is for the case where both these bits are cleared to 0.
section 7 bus controller rev. 5.00 aug 08, 2006 page 193 of 982 rej09b0054-0500 t 1 address bus cs0 as data bus t 2 t 3 t 1 t 2 t 1 full access t 2 rd burst access only lower address changed read data read data read data figure 7.19 example of burst rom access timing (when ast0 = brsts1 = 1) t 1 cs0 as t 2 t 1 t 1 rd address bus data bus full access burst access only lower address changed read data read data read data figure 7.20 example of burst rom access timing (when ast0 = brsts1 = 0)
section 7 bus controller rev. 5.00 aug 08, 2006 page 194 of 982 rej09b0054-0500 7.7.2 wait control as with the basic bus interface, either program wait insertion or pin wait insertion using the wait pin can be used in the initial cycle (full access) of the burst rom interface. see section 7.6.4, wait control. wait states cannot be inserted in a burst cycle. 7.8 idle cycle when this lsi accesses external space, it can insert a 1-state idle cycle (t i ) between bus cycles in the following two cases: (1) when read accesses between different areas occur consecutively, and (2) when a write cycle occurs immediately after a read cycle. by inserting an idle cycle it is possible, for example, to avoid data collisions between rom, with a long output floating time, and high-speed memory, i/o interfaces, and so on. (1) consecutive reads between different areas if consecutive reads between different areas occur while the icis1 bit in bcrh is set to 1, an idle cycle is inserted at the start of the second read cycle. figure 7.21 shows an example of the operation in this case. in this example, bus cycle a is a read cycle from rom with a long output floating time, and bus cycle b is a read cycle from sram, each being located in a different area. in (a), an idle cycle is not inserted, and a collision occurs in cycle b between the read data from rom and that from sram. in (b), an idle cycle is inserted, and a data collision is prevented. t 1 address bus rd bus cycle a data bus t 2 t 3 t 1 t 2 bus cycle b long output floating time data collision (a) idle cycle not inserted (icis1 = 0) t 1 address bus rd bus cycle a data bus t 2 t 3 t i t 1 bus cycle b (b) idle cycle inserted (initial value icis1 = 1) t 2 cs (area a) cs (area b) cs (area a) cs (area b) figure 7.21 example of idle cycle operation (1)
section 7 bus controller rev. 5.00 aug 08, 2006 page 195 of 982 rej09b0054-0500 (2) write after read if an external write occurs after an external read while the icis0 bit in bcrh is set to 1, an idle cycle is inserted at the start of the write cycle. figure 7.22 shows an example of the operation in this case. in this example, bus cycle a is a read cycle from rom with a long output floating time, and bus cycle b is a cpu write cycle. in (a), an idle cycle is not inserted, and a collision occurs in cycle b between the read data from rom and the cpu write data. in (b), an idle cycle is inserted, and a data collision is prevented. t 1 t 2 t 3 t 1 t 2 t 1 t 2 t 3 t i t 1 t 2 address bus ? bus cycle a data bus bus cycle b long output floating time data collision (a) idle cycle not inserted (icis0 = 0) address bus rd bus cycle a data bus bus cycle b (b) idle cycle inserted (initial value icis0 = 1) cs (area a) cs (area b) rd hwr hwr cs (area a) cs (area b) figure 7.22 example of idle cycle operation (2) (3) relationship between chip select ( cs cs cs cs ) signal and read ( rd rd rd rd ) signal depending on the system?s load conditions, the rd signal may lag behind the cs signal. an example is shown in figure 7.23. in this case, with the setting for no idle cycle insertion (a), there may be a period of overlap between the bus cycle a rd signal and the bus cycle b cs signal. setting idle cycle insertion, as in (b), however, will prevent any overlap between the rd and cs signals. in the initial state after reset release, idle cycle insertion (b) is set.
section 7 bus controller rev. 5.00 aug 08, 2006 page 196 of 982 rej09b0054-0500 t 1 t 2 t 3 t 1 t 2 t 1 t 2 t 3 t i t 1 t 2 address bus ? bus cycle a bus cycle b (a) idle cycle not inserted (icis1 = 0) possibility of overlap between cs (area b) and rd address bus bus cycle a bus cycle b (b) idle cycle inserted (initial value icis1 = 1) cs (area a) cs (area b) rd rd cs (area a) cs (area b) figure 7.23 relationship between chip select ( cs cs cs cs ) and read ( rd rd rd rd ) table 7.4 shows pin states in an idle cycle. table 7.4 pin states in idle cycle pins pin state a23 to a0 contents of next bus cycle d15 to d0 high impedance csn high as high rd high hwr high lwr high
section 7 bus controller rev. 5.00 aug 08, 2006 page 197 of 982 rej09b0054-0500 7.9 bus release this lsi can release the external bus in response to a bus request from an external device. in the external bus released state, the internal bus master continues to operate as long as there is no external access. in external extended mode, the bus can be released to an external device by setting the brle bit in bcrl to 1. driving the breq pin low issues an external bus request to this lsi. when the breq pin is sampled, at the prescribed timing the back pin is driven low, and the address bus, data bus, and bus control signals are placed in the high-impedance state, establishing the external bus-released state. in the external bus released state, an internal bus master can perform accesses using the internal bus. when an internal bus master wants to make an external access, it temporarily defers activation of the bus cycle, and waits for the bus request from the external bus master to be dropped. when the breq pin is driven high, the back pin is driven high at the prescribed timing and the external bus released state is terminated. in the event of simultaneous external bus release request and external access request generation, the order of priority is as follows: (high) external bus release > internal bus master external access (low) table 7.5 shows pin states in the external bus released state. table 7.5 pin states in bus released state pins pin state a23 to a0 high impedance d15 to d0 high impedance csn high impedance as high impedance rd high impedance hwr high impedance lwr high impedance
section 7 bus controller rev. 5.00 aug 08, 2006 page 198 of 982 rej09b0054-0500 figure 7.24 shows the timing for transition to the bus-released state. cpu cycle address minimum 1 state t 0 t 1 t 2 hwr , lwr breq back high impedance high impedance as csn high impedance high impedance high impedance rd high impedance data bus address bus [1] [2] [3] [4] [5] [1] low level of breq pin is sampled at rise of t 2 state. [2] back pin is driven low at end of cpu read cycle, releasing bus to external bus master. [3] breq pin state is still sampled in external bus released state. [4] high level of breq pin is sampled. [5] back pin is driven high, ending bus release cycle. cpu cycle external bus released state note : n = 7 to 0 figure 7.24 bus-released state transition timing 7.9.1 bus release usage note when mstpcr is set to h'ffffff and transmitted to sleep mode, the external bus release does not function. to activate the external bus release in sleep mode, do not set mstpcr to h'ffffff.
section 7 bus controller rev. 5.00 aug 08, 2006 page 199 of 982 rej09b0054-0500 7.10 bus arbitration this lsi has a bus arbiter that arbitrates bus master operations. there are three bus masters, the cpu, dmac*, and dtc, which perform read/write operations when they have possession of the bus. each bus master requests the bus by means of a bus request signal. the bus arbiter determines priorities at the prescribed timing, and permits use of the bus by means of a bus request acknowledge signal. the selected bus master then takes possession of the bus and begins its operation. note: * supported only by the h8s/2239 group. 7.10.1 operation the bus arbiter detects the bus masters' bus request signals, and if the bus is requested, sends a bus request acknowledge signal to the bus master making the request. if there are bus requests from more than one bus master, the bus request acknowledge signal is sent to the one with the highest priority. when a bus master receives the bus request acknowledge signal, it takes possession of the bus until that signal is canceled. the order of priority of the bus masters is as follows: (high) dmac* > dtc > cpu (low) an internal bus access by an internal bus master, and external bus release, can be executed in parallel. in the event of simultaneous external bus release request, and internal bus master external access request generation, the order of priority is as follows: (high) external bus release > internal bus master external access (low) note: * supported only by the h8s/2239 group.
section 7 bus controller rev. 5.00 aug 08, 2006 page 200 of 982 rej09b0054-0500 7.10.2 bus transfer timing even if a bus request is received from a bus master with a higher priority than that of the bus master that has acquired the bus and is currently operating, the bus is not necessarily transferred immediately. there are specific times at which each bus master can relinquish the bus. cpu: the cpu is the lowest-priority bus master, and if a bus request is received from the dmac* and dtc, the bus arbiter transfers the bus to the bus master that issued the request. the timing for transfer of the bus is as follows: ? the bus is transferred at a break between bus cycles. however, if a bus cycle is executed in discrete operations, as in the case of a longword-size access, the bus is not transferred between the operations. ? if the cpu is in sleep mode, it transfers the bus immediately. note: * supported only by the h8s/2239 group. dtc: the dtc sends the bus arbiter a request for the bus when an activation request is generated. the dtc can release the bus after a vector read, a register information read (3 states), a single data transfer, or a register information write (3 states). it does not release the bus during a register information read (3 states), a single data transfer, or a register information write (3 states). dmac (only by the h8s/2239 group): the dmac sends the bus arbiter a request for the bus when an activation request is generated. in the case of an external request in short address mode or normal mode, and in cycle steal mode, the dmac releases the bus after a single transfer. in block transfer mode, it releases the bus after transfer of one block, and in burst mode, after completion of the transfer. 7.10.3 external bus release usage note external bus release can be performed on completion of an external bus cycle. the cs signal remains low until the end of the external bus cycle. therefore, when external bus release is performed, the cs signal may change from the low level to the high-impedance state.
section 7 bus controller rev. 5.00 aug 08, 2006 page 201 of 982 rej09b0054-0500 7.11 resets and the bus controller in a power-on reset, this lsi, including the bus controller, enters the reset state at that point, and an executing bus cycle is discontinued. in a manual reset, the bus controller's registers and internal state are maintained, and an executing external bus cycle is completed. in this case, wait input is ignored and write data is not guaranteed. when the dmac* is initialized at the manual reset, dack and tend output is disabled. the dmac* operates as i/o port controlled by ddr and dr. note: * supported only by the h8s/2239 group.
section 7 bus controller rev. 5.00 aug 08, 2006 page 202 of 982 rej09b0054-0500
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 203 of 982 rej09b0054-0500 section 8 dma controller (dmac) the h8s/2239 group has a built-in dma controller (dmac) which can carry out data transfer on up to 4 channels. note: the dmac is supported only by the h8s/2239 group. it is not available in the h8s/2258 group, h8s/2238 group, h8s/2237 group, and h8s/2227 group. 8.1 features ? selectable as short address mode or full address mode ? short address mode: maximum of 4 channels can be used dual address mode or single address mode can be selected in dual address mode, one of the two addresses, transfer source and transfer destination, is specified as 24 bits and the other as 16 bits in single address mode, transfer source or transfer destination address only is specified as 24 bits in single address mode, transfer can be performed in one bus cycle choice of sequential mode, idle mode, or repeat mode for dual address mode and single address mode ? full address mode: maximum of 2 channels can be used transfer source and transfer destination addresses as specified as 24 bits choice of normal mode or block transfer mode ? 16-mbyte address space can be specified directly ? byte or word can be set as the transfer unit ? activation sources: internal interrupt, external request, auto-request (depending on transfer mode) six 16-bit timer-pulse unit (tpu) compare match/input capture interrupts serial communication interface (sci_0, sci_1) transmit-data-empty interrupt, receive-data- full interrupt a/d convert1er conversion end interrupt external request auto-request ? module stop mode can be set
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 204 of 982 rej09b0054-0500 a block diagram of the dmac is shown in figure 8.1. internal address bus address buffer processor internal interrupts tgi0a tgi1a tgi2a tgi3a tgi4a tgi5a txi0 rxi0 txi1 rxi1 adi external pins dreq0 dreq1 tend0 tend1 dack0 dack1 interrupt signals dend0a dend0b dend1a dend1b control logic dmawer dmacr_1b dmacr_1a dmacr_0b dmacr_0a dmatcr dmabcr data buffer internal data bus mar_0ah ioar_0a etcr_0a mar_0bh ioar_0b etcr_0b mar_1ah ioar_1a etcr_1a mar_1bh mar_0al mar_0bl mar_1al mar_1bl ioar_1b etcr_1b legend: dmawer: dma write enable register dmatcr: dma terminal control register dmabcr: dma band control register (for all channels) dmacr: dma control register mar: memory address register ioar: i/o address register etcr: execute transfer count register channel 0 channel 1 channel 0a channel 0b channel 1a channel 1b module data bus figure 8.1 block diagram of dmac
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 205 of 982 rej09b0054-0500 8.2 input/output pins table 8.1 shows the pin configuration of the interrupt controller. table 8.1 pin configuration channel pin name symbol i/o function 0 dma request 0 dreq0 input channel 0 external request dma transfer acknowledge 0 dack0 output channel 0 single address transfer acknowledge dma transfer end 0 tend0 output channel 0 transfer end 1 dma request 1 dreq1 input channel 1 external request dma transfer acknowledge 1 dack1 output channel 1 single address transfer acknowledge dma transfer end 1 tend1 output channel 1 transfer end 8.3 register descriptions ? memory address register_0ah (mar_0ah) ? memory address register_0al (mar_0al) ? i/o address register_0a (ioar_0a) ? transfer count register_0a (etcr_0a) ? memory address register_0bh (mar_0bh) ? memory address register_0bl (mar_0bl) ? i/o address register_0b (ioar_0b) ? transfer count register_0b (etcr_0b) ? memory address register_1ah (mar_1ah) ? memory address register_1al (mar_1al) ? i/o address register_1a (ioar_1a) ? transfer count register_1a (etcr_1b) ? memory address register_1bh (mar_1bh) ? memory address register_1bl (mar_1bl) ? i/o address register_1b (ioar_1b) ? transfer count register_1b (etcr_1b) ? dma control register_0a (dmacr_0a) ? dma control register_0b (dmacr_0b)
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 206 of 982 rej09b0054-0500 ? dma control register_1a (dmacr_1a) ? dma control register_1b (dmacr_1b) ? dma band control register h (dmabcrh) ? dma band control register l (dmabcrl) ? dma write enable register (dmawer) ? dma terminal control register (dmatcr) the functions of mar, ioar, etcr, dmacr, and dmabcr differ according to the transfer mode (short address mode or full address mode). the transfer mode can be selected by means of the fae1 and fae0 bits in dmabcrh. the register configurations for short address mode and full address mode of channel 0 are shown in table 8.2. table 8.2 short address mode and full address mode (channel 0) fae0 description 0 short address mode specified (channels 0a and 0b operate independently) channel 0a mar_0ah specifies transfer source/transfer destination address specifies transfer destination/transfer source address specifies number of transfers specifies transfer size, mode, activation source. specifies transfer source/transfer destination address specifies transfer destination/transfer source address specifies number of transfers specifies transfer size, mode, activation source. ioar_0a etcr_0a dmacr_0a channel 0b mar_0bh mar_0al mar_0bl ioar_0b etcr_0b dmacr_0b 1 full address mode specified (channels 0a and 0b operate in combination as channel 0) channel 0 mar_0ah specifies transfer source address specifies transfer destination address not used not used specifies number of transfers specifies number of transfers (used in block transfer mode only) specifies transfer size, mode, activation source, etc. ioar_0a etcr_0a dmacr_0a mar_0bh mar_0al mar_0bl ioar_0b etcr_0b dmacr_0b
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 207 of 982 rej09b0054-0500 8.3.1 memory address registers (mara and marb) mar is a 32-bit readable/writable register that specifies the source address (transfer source address) or destination address (transfer destination address). mar consists of two 16-bit registers marh and marl. the upper 8 bits of marh are reserved: they are always read as 0, and cannot be modified. the dma has four mar registers: mar_0a in channel 0 (channel 0a), mar_0b in channel 0 (channel 0b), mar_1a in channel 1 (channel 1a), and mar_1b in channel 1 (channel 1b). mar is not initialized by a reset or in standby mode. short address mode: in short address mode, mara and marb operate independently. whether mar functions as the source address register or as the destination address register can be selected by means of the dtdir bit in dmacr. mar is incremented or decremented each time a byte or word transfer is executed, so that the address specified by mar is constantly updated. full address mode: in full address mode, mara functions as the source address register, and marb as the destination address register. mar is incremented or decremented each time a byte or word transfer is executed, so that the source or destination address is constantly updated. 8.3.2 i/o address registers (ioara and ioarb) ioar is a 16-bit readable/writable register that specifies the lower 16 bits of the source address (transfer source address) or destination address (transfer destination address). the upper 8 bits of the transfer address are automatically set to h'ff. the dma has four ioar registers: ioar_0a in channel 0 (channel 0a), ioar_0b in channel 0 (channel 0b), ioar_1a in channel 1 (channel 1a), and ioar_1b in channel 1 (channel 1b). whether ioar functions as the source address register or as the destination address register can be selected by means of the dtdir bit in dmacr. ioar is not incremented or decremented each time a data transfer is executed, so the address specified by ioar is fixed. ioar is not initialized by a reset or in standby mode.
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 208 of 982 rej09b0054-0500 ioar can be used in short address mode but not in full address mode. 8.3.3 execute transfer count registers (etcra and etcrb) etcr is a 16-bit readable/writable register that specifies the number of transfers. the dma has four etcr registers: etcr_0a in channel 0 (channel 0a), etcr_0b in channel 0 (channel 0b), etcr_1a in channel 1 (channel 1a), and etcr_1b in channel 1 (channel 1b). etcr is not initialized by a reset or in standby mode. short address mode: the function of etcr in sequential mode and idle mode differs from that in repeat mode. in sequential mode and idle mode, etcr functions as a 16-bit transfer counter. etcr is decremented by 1 each time a transfer is performed, and when the count reaches h'00, the dte bit in dmabcrl is cleared, and transfer ends. in repeat mode, etcrl functions as an 8-bit transfer counter and etcrh functions as a transfer count holding register. etcrl is decremented by 1 each time a transfer is performed, and when the count reaches h'00, etcrl is loaded with the value in etcrh. at this point, mar is automatically restored to the value it had when the count was started. the dte bit in dmabcrl is not cleared, and so transfers can be performed repeatedly until the dte bit is cleared by the user. full address mode: the function of etcr in normal mode differs from that in block transfer mode. in normal mode, etcra functions as a 16-bit transfer counter. etcra is decremented by 1 each time a data transfer is performed, and transfer ends when the count reaches h'0000. etcrb is not used in normal mode. in block transfer mode, etcral functions as an 8-bit block size counter and etcrah functions as a block size holding register. etcral is decremented by 1 each time a 1-byte or 1-word transfer is performed, and when the count reaches h'00, etcral is loaded with the value in etcrah. so by setting the block size in etcrah and etcral, it is possible to repeatedly transfer blocks consisting of any desired number of bytes or words. in block transfer mode, etcrb functions as a 16-bit block transfer counter. etcrb is decremented by 1 each time a block is transferred, and transfer ends when the count reaches h'0000.
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 209 of 982 rej09b0054-0500 8.3.4 dma control registers (dmacra and dmacrb) dmacr controls the operation of each dmac channel. the dma has four dmacr registers: dmacr_0a in channel 0 (channel 0a), dmacr_0b in channel 0 (channel 0b), dmacr_1a in channel 1 (channel 1a), and dmacr_1b in channel 1 (channel 1b). in short address mode, channels a and b operate independently, and in full address mode, channels a and b operate together. the bit functions in the dmacr registers differ according to the transfer mode. (1) short address mode ? dmacr_0a, dmacr_0b, dmacr_1a, and dmarc_1b bit bit name initial value r/w description 7 dtsz 0 r/w data transfer size selects the size of data to be transferred at one time. 0: byte-size transfer 1: word-size transfer 6 dtid 0 r/w data transfer increment/decrement selects incrementing or decrementing of mar after every data transfer in sequential mode or repeat mode. in idle mode, mar is neither incremented nor decremented. 0: mar is incremented after a data transfer (initial value) ? when dtsz = 0, mar is incremented by 1 ? when dtsz = 1, mar is incremented by 2 1: mar is decremented after a data transfer ? when dtsz = 0, mar is decremented by 1 ? when dtsz = 1, mar is decremented by 2
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 210 of 982 rej09b0054-0500 bit bit name initial value r/w description 5 rpe 0 r/w repeat enable used in combination with the dtie bit in dmabcr to select the mode (sequential, idle, or repeat) in which transfer is to be performed. when dtie = 0 (no transfer end interrupt) 0: transfer in sequential mode 1: transfer in repeat mode when dtie = 1 (with transfer end interrupt) 0: transfer in sequential mode 1: transfer in idle mode 4 dtdir 0 r/w data transfer direction used in combination with the sae bit in dmabcr to specify the data transfer direction (source or destination). the function of this bit is therefore different in dual address mode and single address mode. when sae = 0 0: transfer with mar as source address and ioar as destination address 1: transfer with ioar as source address and mar as destination address when sae = 1 0: transfer with mar as source address and dack pin as write strobe 1: transfer with dack pin as read strobe and mar as destination address
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 211 of 982 rej09b0054-0500 bit bit name initial value r/w description 3 2 1 0 dtf3 dtf2 dtf1 dtf0 0 0 0 0 r/w r/w r/w r/w data transfer factor 3 to 0 these bits select the data transfer factor (activation source). there are some differences in activation sources for channel a and channel b. channel a: 0000: setting prohibited 0001: activated by a/d converter conversion end interrupt 0010: setting prohibited 0011: setting prohibited 0100: activated by sci channel 0 transmit- data-empty interrupt 0101: activated by sci channel 0 receive- data-full interrupt 0110: activated by sci channel 1 transmit- data-empty interrupt 0111: activated by sci channel 1 receive- data-full interrupt 1000: activated by tpu channel 0 compare match/input capture a interrupt 1001: activated by tpu channel 1 compare match/input capture a interrupt 1010: activated by tpu channel 2 compare match/input capture a interrupt 1011: activated by tpu channel 3 compare match/input capture a interrupt 1100: activated by tpu channel 4 compare match/input capture a interrupt 1101: activated by tpu channel 5 compare match/input capture a interrupt 1110: setting prohibited 1111: setting prohibited
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 212 of 982 rej09b0054-0500 bit bit name initial value r/w description 3 2 1 0 dtf3 dtf2 dtf1 dtf0 0 0 0 0 r/w r/w r/w r/w channel b: 0000: setting prohibited 0001: activated by a/d converter conversion end interrupt 0010: activated by dreq pin falling edge input (detected as a low level in the first transfer after transfer is enabled) 0011: activated by dreq pin low-level input 0100: activated by sci channel 0 transmit- data-empty interrupt 0101: activated by sci channel 0 receive- data-full interrupt 0110: activated by sci channel 1 transmit- data-empty interrupt 0111: activated by sci channel 1 receive- data-full interrupt 1000: activated by tpu channel 0 compare match/input capture a interrupt 1001: activated by tpu channel 1 compare match/input capture a interrupt 1010: activated by tpu channel 2 compare match/input capture a interrupt 1011: activated by tpu channel 3 compare match/input capture a interrupt 1100: activated by tpu channel 4 compare match/input capture a interrupt 1101: activated by tpu channel 5 compare match/input capture a interrupt 1110: setting prohibited 1111: setting prohibited the same factor can be selected for more than one channel. in this case, activation starts with the highest-priority channel according to the relative channel priorities. for relative channel priorities, see section 8.5.11, multi-channel operation.
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 213 of 982 rej09b0054-0500 (2) full address mode ? dmacr_0a and dmacr_1a bit bit name initial value r/w description 15 dtsz 0 r/w data transfer size selects the size of data to be transferred at one time. 0: byte-size transfer 1: word-size transfer 14 13 said saide 0 0 r/w r/w source address increment/decrement source address increment/decrement enable these bits specify whether source address register mara is to be incremented, decremented, or left unchanged, when data transfer is performed. 00: mara is fixed 01: mara is incremented after a data transfer ? when dtsz = 0, mara is incremented by 1 ? when dtsz = 1, mara is incremented by 2 10: mara is fixed 11: mara is decremented after a data transfer ? when dtsz = 0, mara is decremented by 1 ? when dtsz = 1, mara is decremented by 2
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 214 of 982 rej09b0054-0500 bit bit name initial value r/w description 12 11 blkdir blke 0 0 r/w r/w block direction block enable these bits specify whether normal mode or block transfer mode is to be used for data transfer. if block transfer mode is specified, the blkdir bit specifies whether the source side or the destination side is to be the block area. 0: transfer in normal mode 01: transfer in block transfer mode (destination side is block area) 11: transfer in block transfer mode (source side is block area) 10 to 8 ? all 0 r/w reserved these bits can be read from or written to. however, the write value should always be 0. legend: : don?t care
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 215 of 982 rej09b0054-0500 ? dmacr_0b and dmacr_1b bit bit name initial value r/w description 7 ? 0r/wreserved this bit can be read from or written to. however, the write value should always be 0. 6 5 daid daide 0 0 r/w r/w destination address increment/decrement destination address increment/decrement enable these bits specify whether destination address register marb is to be incremented, decremented, or left unchanged, when data transfer is performed. 00: marb is fixed 01: marb is incremented after a data transfer ? when dtsz = 0, marb is incremented by 1 ? when dtsz = 1, marb is incremented by 2 10: marb is fixed 11: marb is decremented after a data transfer ? when dtsz = 0, marb is decremented by 1 ? when dtsz = 1, marb is decremented by 2 4? 0 r/wreserved this bit can be read from or written to. however, the write value should always be 0.
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 216 of 982 rej09b0054-0500 bit bit name initial value r/w description 3 2 1 0 dtf3 dtf2 dtf1 dtf0 0 0 0 0 r/w r/w r/w r/w data transfer factor 3 to 0 these bits select the data transfer factor (activation source). the factors that can be specified differ between normal mode and block transfer mode. normal mode 0000: setting prohibited 0001: setting prohibited 0010: activated by dreq pin falling edge input (detected as a low level in the first transfer after transfer is enabled) 0011: activated by dreq pin low-level input 010 : setting prohibited 0110: auto-request (cycle steal) 0111: auto-request (burst) 1 : setting prohibited
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 217 of 982 rej09b0054-0500 bit bit name initial value r/w description 3 2 1 0 dtf3 dtf2 dtf1 dtf0 0 0 0 0 r/w r/w r/w r/w block transfer mode 0000: setting prohibited 0001: activated by a/d converter conversion end interrupt 0010: activated by dreq pin falling edge input (detected as a low level in the first transfer after transfer is enabled) 0011: activated by dreq pin low-level input 0100: activated by sci channel 0 transmit- data-empty interrupt 0101: activated by sci channel 0 receive-data- full interrupt 0110: activated by sci channel 1 transmit- data-empty interrupt 0111: activated by sci channel 1 receive-data- full interrupt 1000: activated by tpu channel 0 compare match/input capture a interrupt 1001: activated by tpu channel 1 compare match/input capture a interrupt 1010: activated by tpu channel 2 compare match/input capture a interrupt 1011: activated by tpu channel 3 compare match/input capture a interrupt 1100: activated by tpu channel 4 compare match/input capture a interrupt 1101: activated by tpu channel 5 compare match/input capture a interrupt 1110: setting prohibited 1111: setting prohibited the same factor can be selected for more than one channel. in this case, activation starts with the highest-priority channel according to the relative channel priorities. for relative channel priorities, see section 8.5.11, multi-channel operation. legend: : don?t care
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 218 of 982 rej09b0054-0500 8.3.5 dma band control registers h and l (dmabcrh and dmabcrl) dmabcr controls the operation of each dmac channel. the bit functions in the dmacr registers differ according to the transfer mode. (1) short address mode ? dmabcrh bit bit name initial value r/w description 15 fae1 0 r/w full address enable 1 specifies whether channel 1 is to be used in short address mode or full address mode. in short address mode, channels 1a and 1b can be used as independent channels. 0: short address mode 1: full address mode 14 fae0 0 r/w full address enable 0 specifies whether channel 0 is to be used in short address mode or full address mode. in short address mode, channels 0a and 0b can be used as independent channels. 0: short address mode 1: full address mode 13 sae1 0 r/w single address enable 1 specifies whether channel 1b is to be used for transfer in dual address mode or single address mode. this bit is invalid in full address mode. 0: dual address mode 1: single address mode 12 sae0 0 r/w single address enable 0 specifies whether channel 0b is to be used for transfer in dual address mode or single address mode. this bit is invalid in full address mode. 0: dual address mode 1: single address mode
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 219 of 982 rej09b0054-0500 bit bit name initial value r/w description 11 10 9 8 dta1b dta1a dta0b dta0a 0 0 0 0 r/w r/w r/w r/w data transfer acknowledge 1b data transfer acknowledge 1a data transfer acknowledge 0b data transfer acknowledge 0a these bits enable or disable clearing when dma transfer is performed for the internal interrupt source selected by the dtf3 to dtf0 bits in dmacr. it the dta bit is set to 1 when dte = 1, the internal interrupt source is cleared automatically by dma transfer. when dte = 1 and dta = 1, the internal interrupt source does not issue an interrupt request to the cpu or dtc. if the dta bit is cleared to 0 when dte = 1, the internal interrupt source is not cleared when a transfer is performed, and can issue an interrupt request to the cpu or dtc in parallel. in this case, the interrupt source should be cleared by the cpu or dtc transfer. when dte = 0, the internal interrupt source issues an interrupt request to the cpu or dtc regardless of the dta bit setting. 0: clearing is disabled when dma transfer is performed for the selected internal interrupt source 1: clearing is enabled when dma transfer is performed for the selected internal interrupt source
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 220 of 982 rej09b0054-0500 ? dmabcrl bit bit name initial value r/w description 7 6 5 4 dte1b dte1a dte0b dte0a 0 0 0 0 r/w r/w r/w r/w data transfer enable 1b data transfer enable 1a data transfer enable 0b data transfer enable 0a if the dte bit is cleared to 0 when dtie = 1, the dmac regards this as indicating the end of a transfer, and issues a transfer end interrupt request to the cpu or dtc. when dte = 0, data transfer is disabled and the dmac ignores the activation source selected by the dtf3 to dtf0 bits in dmacr. when dte = 1, data transfer is enabled and the dmac waits for a request by the activation source selected by the dtf3 to dtf0 bits in dmacr. when a request is issued by the activation source, dma transfer is executed. 0: data transfer is disabled 1: data transfer is enabled [clearing conditions] ? when initialization is performed ? when the specified number of transfers have been completed in a transfer mode other than repeat mode ? when 0 is written to the dte bit to forcibly suspend the transfer, or for a similar reason [setting condition] when 1 is written to the dte bit after reading dte = 0
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 221 of 982 rej09b0054-0500 bit bit name initial value r/w description 3 2 1 0 dtie1b dtie1a dtie0b dtie0a 0 0 0 0 r/w r/w r/w r/w data transfer end interrupt enable 1b data transfer end interrupt enable 1a data transfer end interrupt enable 0b data transfer end interrupt enable 0a these bits enable or disable an interrupt to the cpu or dtc when transfer ends. if the dtie bit is set to 1 when dte = 0, the dmac regards this as indicating the end of a transfer, and issues a transfer end interrupt request to the cpu or dtc. a transfer end interrupt can be canceled either by clearing the dtie bit to 0 in the interrupt handling routine, or by performing processing to continue transfer by setting the transfer counter and address register again, and then setting the dte bit to 1. 0: transfer end interrupt is disabled 1: transfer end interrupt is enabled (2) full address mode ? dmabcrh bit bit name initial value r/w description 15 fae1 0 r/w full address enable 1 specifies whether channel 1 is to be used in short address mode or full address mode. in full address mode, channels 1a and 1b are used together as channel 1. 0: short address mode 1: full address mode 14 fae0 0 r/w full address enable 0 specifies whether channel 0 is to be used in short address mode or full address mode. in full address mode, channels 0a and 0b are used together as channel 0. 0: short address mode 1: full address mode
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 222 of 982 rej09b0054-0500 bit bit name initial value r/w description 13, 12 ? all 0 r/w reserved these bits can be read from or written to. however, the write value should always be 0. 11 dta1 0 r/w data transfer acknowledge 1 these bits enable or disable clearing when dma transfer is performed for the internal interrupt source selected by the dtf3 to dtf0 bits in dmacr of channel 1. it the dta1 bit is set to 1 when dte1 = 1, the internal interrupt source is cleared automatically by dma transfer. when dte1 = 1 and dta1 = 1, the internal interrupt source does not issue an interrupt request to the cpu or dtc. it the dta1 bit is cleared to 0 when dte1 = 1, the internal interrupt source is not cleared when a transfer is performed, and can issue an interrupt request to the cpu or dtc in parallel. in this case, the interrupt source should be cleared by the cpu or dtc transfer. when dte1 = 0, the internal interrupt source issues an interrupt request to the cpu or dtc regardless of the dta1 bit setting. the state of the dtme1 bit does not affect the above operations. 0: clearing is disabled when dma transfer is performed for the selected internal interrupt source 1: clearing is enabled when dma transfer is performed for the selected internal interrupt source 10 ? 0 r/w reserved this bit can be read from or written to. however, the write value should always be 0.
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 223 of 982 rej09b0054-0500 bit bit name initial value r/w description 9dta0 0 r/w data transfer acknowledge 0 these bits enable or disable clearing when dma transfer is performed for the internal interrupt source selected by the dtf3 to dtf0 bits in dmacr of channel 0. it the dta0 bit is set to 1 when dte0 = 1, the internal interrupt source is cleared automatically by dma transfer. when dte0 = 1 and dta0 = 1, the internal interrupt source does not issue an interrupt request to the cpu or dtc. it the dta0 bit is cleared to 0 when dte0 = 1, the internal interrupt source is not cleared when a transfer is performed, and can issue an interrupt request to the cpu or dtc in parallel. in this case, the interrupt source should be cleared by the cpu or dtc transfer. when dte0 = 0, the internal interrupt source issues an interrupt request to the cpu or dtc regardless of the dta0 bit setting. the state of the dtme0 bit does not affect the above operations. 0: clearing is disabled when dma transfer is performed for the selected internal interrupt source 1: clearing is enabled when dma transfer is performed for the selected internal interrupt source 8? 0 r/wreserved this bit can be read from or written to. however, the write value should always be 0.
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 224 of 982 rej09b0054-0500 ? dmabcrl bit bit name initial value r/w description 7 dtme1 0 r/w data transfer master enable 1 together with the dte1 bit, this bit controls enabling or disabling of data transfer on channel 1. when both the dtme1 bit and dte1 bit are set to 1, transfer is enabled for channel 1. if channel 1 is in the middle of a burst mode transfer when an nmi interrupt is generated, the dtme1 bit is cleared, the transfer is interrupted, and bus mastership passes to the cpu. when the dtme1 bit is subsequently set to 1 again, the interrupted transfer is resumed. in block transfer mode, however, the dtme1 bit is not cleared by an nmi interrupt, and transfer is not interrupted. 0: data transfer is disabled 1: data transfer is enabled [clearing conditions] ? when initialization is performed ? when nmi is input in burst mode ? when 0 is written to the dtme1 bit [setting condition] when 1 is written to dtme1 after reading dtme1 = 0
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 225 of 982 rej09b0054-0500 bit bit name initial value r/w description 6 dte1 0 r/w data transfer enable 1 enables or disables dma transfer for the activation source selected by the dtf3 to dtf0 bits in dmacr of channel 1. when dte1 = 0, data transfer is disabled and the activation source is ignored. if the activation source is an internal interrupt, an interrupt request is issued to the cpu or dtc. if the dte1 bit is cleared to 0 when dtie1 = 1, the dmac regards this as indicating the end of a transfer, and issues a transfer end interrupt request to the cpu. when dte1 = 1 and dtme1 = 1, data transfer is enabled and the dmac waits for a request by the activation source. when a request is issued by the activation source, dma transfer is executed. 0: data transfer is disabled 1: data transfer is enabled [clearing conditions] ? when initialization is performed ? when the specified number of transfers have been completed ? when 0 is written to the dte1 bit to forcibly suspend the transfer, or for a similar reason [setting condition] when 1 is written to the dte1 bit after reading dte1 = 0
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 226 of 982 rej09b0054-0500 bit bit name initial value r/w description 5 dtme0 0 r/w data transfer master enable 0 together with the dte0 bit, this bit controls enabling or disabling of data transfer on channel 0. when both the dtme0 bit and dte0 bit are set to 1, transfer is enabled for channel 0. if channel 0 is in the middle of a burst mode transfer when an nmi interrupt is generated, the dtme0 bit is cleared, the transfer is interrupted, and bus mastership passes to the cpu. when the dtme0 bit is subsequently set to 1 again, the interrupted transfer is resumed. in block transfer mode, however, the dtme0 bit is not cleared by an nmi interrupt, and transfer is not interrupted. 0: data transfer is disabled 1: data transfer is enabled [clearing conditions] ? when initialization is performed ? when nmi is input in burst mode ? when 0 is written to the dtme0 bit [setting condition] when 1 is written to dtme0 after reading dtme0 = 0
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 227 of 982 rej09b0054-0500 bit bit name initial value r/w description 4 dte0 0 r/w data transfer enable 0 enables or disables dma transfer for the activation source selected by the dtf3 to dtf0 bits in dmacr of channel 0. when dte0 = 0, data transfer is disabled and the activation source is ignored. if the activation source is an internal interrupt, an interrupt request is issued to the cpu or dtc. if the dte0 bit is cleared to 0 when dtie0 = 1, the dmac regards this as indicating the end of a transfer, and issues a transfer end interrupt request to the cpu. when dte0 = 1 and dtme0 = 1, data transfer is enabled and the dmac waits for a request by the activation source. when a request is issued by the activation source, dma transfer is executed. 0: data transfer is disabled 1: data transfer is enabled [clearing conditions] ? when initialization is performed ? when the specified number of transfers have been completed ? when 0 is written to the dte0 bit to forcibly suspend the transfer, or for a similar reason [setting condition] when 1 is written to the dte0 bit after reading dte0 = 0 3 dtie1b 0 r/w data transfer interrupt enable 1b enables or disables an interrupt to the cpu or dtc when transfer on channel 1 is interrupted. if the dtme1 bit is cleared to 0 when dtie1b = 1, the dmac regards this as indicating a break in the transfer, and issues a transfer break interrupt request to the cpu or dtc. a transfer break interrupt can be canceled either by clearing the dtie1b bit to 0 in the interrupt handling routine, or by performing processing to continue transfer by setting the dtme1 bit to 1. 0: data transfer is disabled 1: data transfer is enabled
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 228 of 982 rej09b0054-0500 bit bit name initial value r/w description 2 dtie1a 0 r/w data transfer end interrupt enable 1a enables or disables an interrupt to the cpu or dtc when transfer ends. if the dte1 bit is cleared to 1 when dtie1a = 1, the dmac regards this as indicating the end of a transfer, and issues a transfer end interrupt request to the cpu or dtc. a transfer end interrupt can be canceled either by clearing the dtie1a bit to 0 in the interrupt handling routine, or by performing processing to continue transfer by setting the transfer counter and address register again, and then setting the dte1 bit to 1. 0: data transfer is disabled 1: data transfer is enabled 1 dtie0b 0 r/w data transfer interrupt enable 0b enables or disables an interrupt to the cpu or dtc when transfer on channel 1 is interrupted. if the dtme0 bit is cleared to 0 when dtie0b = 1, the dmac regards this as indicating a break in the transfer, and issues a transfer break interrupt request to the cpu or dtc. a transfer break interrupt can be canceled either by clearing the dtie0b bit to 0 in the interrupt handling routine, or by performing processing to continue transfer by setting the dtme0 bit to 1. 0: data transfer is disabled 1: data transfer is enabled 0 dtie0a 0 r/w data transfer end interrupt enable 0a enables or disables an interrupt to the cpu or dtc when transfer ends. if the dte0 bit is cleared to 0 when dtie0a = 1, the dmac regards this as indicating the end of a transfer, and issues a transfer end interrupt request to the cpu or dtc. a transfer end interrupt can be canceled either by clearing the dtie0a bit to 0 in the interrupt handling routine, or by performing processing to continue transfer by setting the transfer counter and address register again, and then setting the dte0 bit to 1. 0: data transfer is disabled 1: data transfer is enabled
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 229 of 982 rej09b0054-0500 8.3.6 dma write enable register (dmawer) the dmac can activate the dtc with a transfer end interrupt, rewrite the channel on which the transfer ended using a dtc chain transfer, and then reactivate the dtc. dmawer applies restrictions for changing all bits of dmacr, and specific bits for dmatcr and dmabcr for the specific channel, to prevent inadvertent rewriting of registers other than those for the channel concerned. the restrictions applied by dmawer are valid for the dtc. bit bit name initial value r/w description 7 to 4 ? all 0 ? reserved these bits are always read as 0 and cannot be modified. 3 we1b 0 r/w write enable 1b enables or disables writes to all bits in dmacr1b, bits 11, 7, and 3 in dmabcr, and bit 5 in dmatcr. 0: writes are disabled 1: writes are enabled 2 we1a 0 r/w write enable 1a enables or disables writes to all bits in dmacr1a, and bits 10, 6, and 2 in dmabcr. 0: writes are disabled 1: writes are enabled 1 we0b 0 r/w write enable 0b enables or disables writes to all bits in dmacr0b, bits 9, 5, and 1 in dmabcr, and bit 4 in dmatcr. 0: writes are disabled 1: writes are enabled 0 we0a 0 r/w write enable 0a enables or disables writes to all bits in dmacr0a, and bits 8, 4, and 0 in dmabcr. 0: writes are disabled 1: writes are enabled figure 8.2 shows the transfer areas for activating the dtc with a channel 0a transfer end interrupt request, and reactivating channel 0a. the address register and count register areas are set again during the first dtc transfer, then the control register area is set again during the second dtc
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 230 of 982 rej09b0054-0500 chain transfer. when re-setting the control register area, perform masking by setting bits in dmawer to prevent modification of the contents of other channels. dtc ioar_0a etcr_0a ioar_0b etcr_0b ioar_1a etcr_1a ioar_1b etcr_1b dmatcr dmacr_0b dmacr_1b dmawer dmacr_0a dmacr_1a dmabcr second transfer area using chain transfer first transfer area mar_0ah mar_0al mar_0bh mar_0bl mar_1ah mar_1al mar_1bh mar_1bl figure 8.2 areas for register re-setting by dtc (channel 0a) writes by the dtc to bits 15 to 12 (fae and sae) in dmabcr are invalid regardless of the dmawer settings. these bits should be changed, if necessary, by cpu processing. in writes by the dtc to bits 7 to 4 (dte) in dmabcr, 1 can be written without first reading 0. to reactivate a channel set to full address mode, write 1 to both write enable a and write enable b for the channel to be reactivated. mar, ioar, and etcr can always be written to regardless of the dmawer settings. when modifying these registers, the channel to be modified should be halted.
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 231 of 982 rej09b0054-0500 8.3.7 dma terminal control register (dmatcr) dmatcr controls enabling or disabling of output from the dmac transfer end pin. a port can be set for output automatically, and a transfer end signal output, by setting the appropriate bit. the tend pin is available only for channel b in short address mode. except for the block transfer mode, a transfer end signal asserts in the transfer cycle in which the transfer counter contents reaches 0 regardless of the activation source. in the block transfer mode, a transfer end signal asserts in the transfer cycle in which the block counter contents reaches 0. bit bit name initial value r/w description 7, 6 ? all 0 ? reserved these bits are always read as 0 and cannot be modified. 5 tee1 0 r/w transfer end enable 1 enables or disables transfer end pin 1 ( tend1 ) output. 0: tend1 pin output disabled 1: tend1 pin output enabled 4 tee0 0 r/w transfer end enable 0 enables or disables transfer end pin 0 ( tend0 ) output. 0: tend0 pin output disabled 1: tend0 pin output enabled 3 to 0 ? all 0 ? reserved these bits are always read as 0 and cannot be modified. 8.4 activation sources dmac activation sources consist of internal interrupt requests, external requests, and auto- requests. the dmac activation sources that can be specified depend on the transfer mode and channel, as shown in table 8.3.
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 232 of 982 rej09b0054-0500 table 8.3 dmac activation sources short address mode full address mode activation source channels 0a and 1a channels 0b and 1b normal mode block transfer mode adi o o o txi0 o o o rxi0 o o o txi1 o o o rxi1 o o o tgi0a o o o tgi1a o o o tgi2a o o o tgi3a o o o tgi4a o o o internal interrupts tgi5a o o o dreq pin falling edge input ooo external requests dreq pin low-level input ooo auto-request o legend: o: can be specified : cannot be specified 8.4.1 activation by internal interrupt request an interrupt request selected as a dmac activation source can also simultaneously generate an interrupt request for the cpu or dtc. for details, see section 5, interrupt controller. with activation by an internal interrupt request, the dmac accepts the interrupt request independently of the interrupt controller. consequently, interrupt controller priority settings are irrelevant. if the dmac is activated by a cpu interrupt source or an interrupt request that is not used as a dtc activation source (dta = 1), the interrupt request flag is cleared automatically by the dma transfer. with adi, txi, and rxi interrupts, however, the interrupt source flag is not cleared unless the relevant register is accessed in a dma transfer. if the same interrupt is used as an activation source for more than one channel, the interrupt request flag is cleared when the highest-
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 233 of 982 rej09b0054-0500 priority channel is activated. transfer requests for other channels are held pending in the dmac, and activation is carried out in order of priority. when dte = 0 after completion of a transfer, an interrupt request from the selected activation source is not sent to the dmac, regardless of the dta bit setting. in this case, the relevant interrupt request is sent to the cpu or dtc. when an interrupt request signal for dmac activation is also used for an interrupt request to the cpu or dtc activation (dta = 0), the interrupt request flag is not cleared by the dmac. 8.4.2 activation by external request if an external request ( dreq pin) is specified as a dmac activation source, the relevant port should be set to input mode in advance. level sensing or edge sensing can be used for external requests. external request operation in normal mode of short address mode or full address mode is described below. when edge sensing is selected, a byte or word is transferred each time a high-to-low transition is detected on the dreq pin. the next data transfer may not be performed if the next edge is input before data transfer is completed. when level sensing is selected, the dmac stands by for a transfer request while the dreq pin is held high. while the dreq pin is held low, transfers continue in succession, with the bus being released each time a byte or word is transferred. if the dreq pin goes high in the middle of a transfer, the transfer is interrupted and the dmac stands by for a transfer request. 8.4.3 activation by auto-request auto-request is activated by register setting only, and transfer continues to the end. with auto- request activation, cycle steal mode or burst mode can be selected. in cycle steal mode, the dmac releases the bus to another bus master each time a byte or word is transferred. dma and cpu cycles are usually repeated alternately. in burst mode, the dmac keeps possession of the bus until the end of the transfer so that transfer is performed continuously.
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 234 of 982 rej09b0054-0500 8.5 operation 8.5.1 transfer modes table 8.4 lists the dmac transfer modes. table 8.4 dmac transfer modes transfer mode transfer source remarks dual address mode ? 1-byte or 1-word transfer for a single transfer request ? specify source and destination addresses to transfer data in two bus cycles. (1) sequential mode ? memory address incremented or decremented by 1 or 2 ? number of transfers: 1 to 65,536 (2) idle mode ? memory address fixed ? number of transfers: 1 to 65,536 (3) repeat mode ? memory address incremented or decremented by 1 or 2 ? continues transfer after sending number of transfers (1 to 256) and restoring the initial value ? tpu channel 0 to 5 compare match/input capture a interrupt ? sci transmit-data- empty interrupt ? sci receive-data- full interrupt ? a/d converter conversion end interrupt ? external request short address mode single address mode ? 1-byte or 1-word transfer for a single transfer request ? 1-bus cycle transfer by means of dack pin instead of using address for specifying i/o ? sequential mode, idle mode, or repeat mode can be specified ? external request ? up to 4 channels can operate independently ? external request applies to channel b only ? single address mode applies to channel b only
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 235 of 982 rej09b0054-0500 transfer mode transfer source remarks normal mode (1) auto-request ? transfer request is internally held ? number of transfers (1 to 65,536) is continuously sent ? burst/cycle steal transfer can be selected ? auto-request full address mode (2) external request ? 1-byte or 1-word transfer for a single transfer request ? number of transfers: 1 to 65,536 ? external request ? max. 2-channel operation, combining channels a and b block transfer mode ? transfer of 1-block, size selected for a single transfer request ? number of transfers: 1 to 65,536 ? source or destination can be selected as block area ? block size: 1 to 256 bytes or word ? tpu channel 0 to 5 compare match/input capture a interrupt ? sci transmit-data- empty interrupt ? sci receive-data- full interrupt ? a/d converter conversion end interrupt ? external request
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 236 of 982 rej09b0054-0500 8.5.2 sequential mode sequential mode can be specified by clearing the rpe bit in dmacr to 0. in sequential mode, mar is updated after each byte or word transfer in response to a single transfer request, and this is executed the number of times specified in etcr. one address is specified by mar, and the other by ioar. the transfer direction can be specified by the dtdir bit in dmacr. table 8.5 summarizes register functions in sequential mode. table 8.5 register functions in sequential mode function register dtdir = 0 dtdir = 1 initial setting operation 23 0 mar source address register destination address register start address of transfer destination or transfer source incremented/ decremented every transfer 23 0 ioar 15 h'ff destination address register source address register start address of transfer source or transfer destination fixed 0 etcr 15 transfer counter number of transfers decremented every transfer; transfer ends when count reaches h'0000 mar specifies the start address of the transfer source or transfer destination as 24 bits. mar is incremented or decremented by 1 or 2 each time a byte or word is transferred. ioar specifies the lower 16 bits of the other address. the 8 bits above ioar have a value of h'ff. figure 8.3 illustrates operation in sequential mode.
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 237 of 982 rej09b0054-0500 address t address b transfer ioar 1 byte or word transfer performed in response to 1 transfer request legend: address t = l address b = l + ( 1) dtid (2 dtsz (n 1)) where : l = value set in mar n = value set in etcr figure 8.3 operation in sequential mode the number of transfers is specified as 16 bits in etcr. etcr is decremented by 1 each time a data transfer is executed, and when its value reaches h'0000, the dte bit is cleared and data transfer ends. if the dtie bit is set to 1 at this time, an interrupt request is sent to the cpu or dtc. the maximum number of transfers, when h'0000 is set in etcr, is 65,536. transfer requests (activation sources) consist of a/d converter conversion end interrupts, external requests, sci transmit-data-empty and receive-data-full interrupts, and tpu channel 0 to 5 compare match/input capture a interrupts. external requests can only be specified for channel b. figure 8.4 shows an example of the setting procedure for sequential mode.
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 238 of 982 rej09b0054-0500 sequential mode setting set dmabcrh set transfer source and transfer destination addresses set number of transfers set dmacr read dmabcrl set dmabcrl sequential mode [1] [2] [3] [4] [5] [6] [1] set each bit in dmabcrh. clear the fae bit to 0 to select short address mode. specify enabling or disabling of internal interrupt clearing with the dta bit. [2] set the transfer source address and transfer destination address in mar and ioar. [3] set the number of transfers in etcr. [4] set each bit in dmacr. set the transfer data size with the dtsz bit. specify whether mar is to be incremented or decremented with the dtid bit. clear the rpe bit to 0 to select sequential mode. specify the transfer direction with the dtdir bit. select the activation source with bits dtf3 to dtf0. [5] read the dte bit in dmabcrl as 0. [6] set each bit in dmabcrl. specify enabling or disabling of transfer end interrupts with the dtie bit. set the dte bit to 1 to enable transfer. figure 8.4 example of sequential mode setting procedure
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 239 of 982 rej09b0054-0500 8.5.3 idle mode idle mode can be specified by setting the rpe bit in dmacr and dtie bit in dmabcrl to 1. in idle mode, one byte or word is transferred in response to a single transfer request, and this is executed the number of times specified in etcr. one address is specified by mar, and the other by ioar. the transfer direction can be specified by the dtdir bit in dmacr. table 8.6 summarizes register functions in idle mode. table 8.6 register functions in idle mode function register dtdir = 0 dtdir = 1 initial setting operation 23 0 mar source address register destination address register start address of transfer destination or transfer source fixed 23 0 ioar 15 h'ff destination address register source address register start address of transfer source or transfer destination fixed 0 etcr 15 transfer counter number of transfers decremented every transfer; transfer ends when count reaches h'0000 mar specifies the start address of the transfer source or transfer destination as 24 bits. mar is neither incremented nor decremented by a data transfer. ioar specifies the lower 16 bits of the other address. the upper 8 bits of ioar have a value of h'ff. figure 8.5 illustrates operation in idle mode. transfer ioar 1 byte or word transfer performed in response to 1 transfer request mar figure 8.5 operation in idle mode the number of transfers is specified as 16 bits in etcr. etcr is decremented by 1 each time a transfer is executed, and when its value reaches h'0000, the dte bit is cleared and data transfer ends. if the dtie bit is set to 1 at this time, an interrupt request is sent to the cpu or dtc. the maximum number of transfers, when h'0000 is set in etcr, is 65,536.
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 240 of 982 rej09b0054-0500 transfer requests (activation sources) consist of a/d converter conversion end interrupts, external requests, sci transmit-data-empty and receive-data-full interrupts, and tpu channel 0 to 5 compare match/input capture a interrupts. external requests can only be specified for channel b. figure 8.6 shows an example of the setting procedure for idle mode. idle mode setting set dmabcrh set transfer source and transfer destination addresses set number of transfers set dmacr read dmabcrl set dmabcrl idle mode [1] [2] [3] [4] [5] [6] [1] set each bit in dmabcrh. clear the fae bit to 0 to select short address mode. specify enabling or disabling of internal interrupt clearing with the dta bit. [2] set the transfer source address and transfer destination address in mar and ioar. [3] set the number of transfers in etcr. [4] set each bit in dmacr. set the transfer data size with the dtsz bit. specify whether mar is to be incremented or decremented with the dtid bit. set the rpe bit to 1. specify the transfer direction with the dtdir bit. select the activation source with bits dtf3 to dtf0. [5] read the dte bit in dmabcrl as 0. [6] set each bit in dmabcrl. set the dtie bit to 1. set the dte bit to 1 to enable transfer. figure 8.6 example of idle mode setting procedure
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 241 of 982 rej09b0054-0500 8.5.4 repeat mode repeat mode can be specified by setting the rpe bit in dmacr to 1, and clearing the dtie bit in dmabcrl to 0. in repeat mode, mar is updated after each byte or word transfer in response to a single transfer request, and this is executed the number of times specified in etcrl. on completion of the specified number of transfers, mar and etcrl are automatically restored to their original settings and operation continues. one address is specified by mar, and the other by ioar. the transfer direction can be specified by the dtdir bit in dmacr. table 8.7 summarizes register functions in repeat mode. table 8.7 register functions in repeat mode function register dtdir = 0 dtdir = 1 initial setting operation 23 0 mar source address register destination address register start address of transfer destination or transfer source incremented/ decremented every transfer initial setting is restored when value reaches h'0000 23 0 ioar 15 h'ff destination address register source address register start address of transfer source or transfer destination fixed 0 etcrh 7 holds number of transfers number of transfers fixed 0 etcrl 7 transfer counter number of transfers decremented every transfer loaded with etcrh value when count reaches h'00 mar specifies the start address of the transfer source or transfer destination as 24 bits. mar is incremented or decremented by 1 or 2 each time a byte or word is transferred. ioar specifies the lower 16 bits of the other address. the upper 8 bits of ioar have a value of h'ff. the number of transfers is specified as 8 bits by etcrh and etcrl. the maximum number of transfers, when h'00 is set in both etcrh and etcrl, is 256. in repeat mode, etcrl functions as the transfer counter, and etcrh is used to hold the number of transfers. etcrl is decremented by 1 each time a data transfer is executed, and when its value reaches h'00, it is loaded with the value in etcrh. at the same time, the value set in mar is
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 242 of 982 rej09b0054-0500 restored in accordance with the values of the dtsz and dtid bits in dmacr. the mar restoration operation is as shown below. mar = mar ? (?1) dtid 2 dtsz etcrh the same value should be set in etcrh and etcrl. in repeat mode, operation continues until the dte bit in dmabcrl is cleared. to end the transfer operation, therefore, the dte bit should be cleared to 0. a transfer end interrupt request is not sent to the cpu or dtc. by setting the dte bit to 1 again after it has been cleared, the operation can be restarted from the transfer after that terminated when the dte bit was cleared. figure 8.7 illustrates operation in repeat mode. address t address b transfer ioar 1 byte or word transfer performed in response to 1 transfer request legend: address t = l address b = l + ( 1) dtid (2 dtsz (n 1)) where : l = value set in mar n = value set in etcr figure 8.7 operation in repeat mode
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 243 of 982 rej09b0054-0500 transfer requests (activation sources) consist of a/d converter conversion end interrupts, external requests, sci transmit-data-empty and receive-data-full interrupts, and tpu channel 0 to 5 compare match/input capture a interrupts. external requests can only be specified for channel b. figure 8.8 shows an example of the setting procedure for repeat mode. repeat mode setting set dmabcrh set transfer source and transfer destination addresses set number of transfers set dmacr read dmabcrl set dmabcrl repeat mode [1] [2] [3] [4] [5] [6] [1] set each bit in dmabcrh. clear the fae bit to 0 to select short address mode. specify enabling or disabling of internal interrupt clearing with the dta bit. [2] set the transfer source address and transfer destination address in mar and ioar. [3] set the number of transfers in both etcrh and etcrl. [4] set each bit in dmacr. set the transfer data size with the dtsz bit. specify whether mar is to be incremented or decremented with the dtid bit. set the rpe bit to 1. specify the transfer direction with the dtdir bit. select the activation source with bits dtf3 to dtf0. [5] read the dte bit in dmabcrl as 0. [6] set each bit in dmabcrl. clear the dtie bit to 0. set the dte bit to 1 to enable transfer. figure 8.8 example of repeat mode setting procedure
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 244 of 982 rej09b0054-0500 8.5.5 single address mode dmac supports the dual address mode, in which two different cycles are used for reading and writing, and the single address mode, in which a single cycle is used for both reading and writing. in dual address mode, the source address and the destination address are specified respectively for transferring data. in single address mode, data is transferred between the external space, in which the transfer source or transfer destination is specified by the address, and the external device that is selected by dack strobe regardless of the address. figure 8.9 shows the data bus in single address mode. rd hwr , lwr a23 to a0 address bus external memory external device (write) (read) data bus d15 to d0 (high impedance) this lsi dack figure 8.9 data bus in single address mode when the data bus is used for reading in single address mode, data is transferred from the external memory to the external device and the dack pin functions as the write strobe for the external device. when the data bus is used for writing in single address mode, data is transferred from the external device to the external memory and the dack pin functions as the read strobe for the external device. since the direction for the external device cannot be controlled, chose one of directions described above. the setting of the bus controller for the external memory area controls the bus cycle in single address mode. to the external device, dack is output in synchronization with the address strobe. for details on the bus cycle, see section 8.5.10, dma transfer (single address mode) bus cycles. in single address mode, do not specify the internal area for the transfer address.
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 245 of 982 rej09b0054-0500 single address mode can only be specified for channel b. this mode can be specified by setting the sae bit in dmabcrh to 1 in short address mode. one address is specified by mar, and the other is set automatically to the data transfer acknowledge pin ( dack ). the transfer direction can be specified by the dtdir bit in dmacr. table 8.8 summarizes register functions in single address mode. table 8.8 register functions in single address mode function register dtdir = 0 dtdir = 1 initial setting operation 23 0 mar source address register destination address register start address of transfer destination or transfer source see sections 8.5.2, sequential mode, 8.5.3, idle mode, and 8.5.4, repeat mode. dack pin write strobe read strobe (set automatically by sae bit; ioar is invalid) strobe for external device 0 etcr 15 transfer counter number of transfers see sections 8.5.2, sequential mode, 8.5.3, idle mode, and 8.5.4, repeat mode. mar specifies the start address of the transfer source or transfer destination as 24 bits. ioar is invalid; in its place the strobe for external devices ( dack ) is output.
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 246 of 982 rej09b0054-0500 figure 8.10 illustrates operation in single address mode (when sequential mode is specified). address t address b transfer dac k 1 byte or word transfer performed in response to 1 transfer request legend: address t = l address b = l + ( 1) dtid (2 dtsz (n 1)) where : l = value set in mar n = value set in etcr figure 8.10 operation in single address mode (when sequential mode is specified) figure 8.11 shows an example of the setting procedure for single address mode (when sequential mode is specified).
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 247 of 982 rej09b0054-0500 single address mode setting set dmabcrh set transfer source and transfer destination addresses set number of transfers set dmacr read dmabcrl set dmabcrl single address mode [1] [2] [3] [4] [5] [6] [1] set each bit in dmabcrh. clear the fae bit to 0 to select short address mode. set the sae bit to 1 to select single address mode. specify enabling or disabling of internal interrupt clearing with the dta bit. [2] set the transfer source address/transfer destination address in mar. [3] set the number of transfers in etcr. [4] set each bit in dmacr. set the transfer data size with the dtsz bit. specify whether mar is to be incremented or decremented with the dtid bit. clear the rpe bit to 0 to select sequential mode. specify the transfer direction with the dtdir bit. select the activation source with bits dtf3 to dtf0. [5] read the dte bit in dmabcrl as 0. [6] set each bit in dmabcrl. specify enabling or disabling of transfer end interrupts with the dtie bit. set the dte bit to 1 to enable transfer. figure 8.11 example of single address mode setting procedure (when sequential mode is specified)
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 248 of 982 rej09b0054-0500 8.5.6 normal mode in normal mode, transfer is performed with channels a and b used in combination. normal mode can be specified by setting the fae bit in dmabcrh to 1 and clearing the blke bit in dmacra to 0. in normal mode, mar is updated after data transfer of a byte or word in response to a single transfer request, and this is executed the number of times specified in etcra. the transfer source is specified by mara, and the transfer destination by marb. table 8.9 summarizes register functions in normal mode. table 8.9 register functions in normal mode register function initial setting operation 23 0 mara source address register start address of transfer source incremented/decremented every transfer, or fixed 23 0 marb destination address register start address of transfer destination incremented/decremented every transfer, or fixed 0 etcra 15 transfer counter number of transfers decremented every transfer; transfer ends when count reaches h'0000 mara and marb specify the start addresses of the transfer source and transfer destination, respectively, as 24 bits. mar can be incremented or decremented by 1 or 2 each time a byte or word is transferred, or can be fixed. incrementing, decrementing, or holding a fixed value can be set separately for mara and marb. the number of transfers is specified by etcra as 16 bits. etcra is decremented by 1 each time a transfer is performed, and when its value reaches h'0000 the dte bit in dmabcrl is cleared and transfer ends. if the dtie bit in dmabcrl is set to 1 at this time, an interrupt request is sent to the cpu or dtc. the maximum number of transfers, when h'0000 is set in etcra, is 65,536.
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 249 of 982 rej09b0054-0500 figure 8.12 illustrates operation in normal mode. address t a address b a transfer address t b legend: address address address address where : address b b = l a = l b = l a + saide ( 1) said (2 dtsz (n 1)) = l b + daide ( 1) daid (2 dtsz (n 1)) = value set in mara = value set in marb = value set in etcra t a t b b a b b l a l b n figure 8.12 operation in normal mode transfer requests (activation sources) are external requests and auto-requests. with auto-request, the dmac is only activated by register setting, and the specified number of transfers are performed automatically. with auto-request, cycle steal mode or burst mode can be selected. in cycle steal mode, the bus is released to another bus master each time a transfer is performed. in burst mode, the bus is held continuously until transfer ends.
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 250 of 982 rej09b0054-0500 figure 8.13 shows an example of the setting procedure for normal mode. normal mode setting set dmabcrh set transfer source and transfer destination addresses set number of transfers set dmacr read dmabcrl set dmabcrl normal mode [1] [2] [3] [4] [5] [6] [1] set each bit in dmabcrh. set the fae bit to 1 to select full address mode. specify enabling or disabling of internal interrupt clearing with the dta bit. [2] set the transfer source address in mara, and the transfer destination address in marb. [3] set the number of transfers in etcra. [4] set each bit in dmacra and dmacrb. set the transfer data size with the dtsz bit. specify whether mara is to be incremented, decremented, or fixed, with the said and saide bits. clear the blke bit to 0 to select normal mode. specify whether marb is to be incremented, decremented, or fixed, with the daid and daide bits. select the activation source with bits dtf3 to dtf0. [5] read dte = 0 and dtme = 0 in dmabcrl. [6] set each bit in dmabcrl. specify enabling or disabling of transfer end interrupts with the dtie bit. set both the dtme bit and the dte bit to 1 to enable transfer. figure 8.13 example of normal mode setting procedure
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 251 of 982 rej09b0054-0500 8.5.7 block transfer mode in block transfer mode, data transfer is performed with channels a and b used in combination. block transfer mode can be specified by setting the fae bit in dmabcrh and the blke bit in dmacra to 1. in block transfer mode, a data transfer of the specified block size is carried out in response to a single transfer request, and this is executed for the number of times specified in etcrb. the transfer source is specified by mara, and the transfer destination by marb. either the transfer source or the transfer destination can be selected as a block area (an area composed of a number of bytes or words). table 8.10 summarizes register functions in block transfer mode. table 8.10 register functions in block transfer mode register function initial setting operation 23 0 mara source address register start address of transfer source incremented/decremented every transfer, or fixed 23 0 marb destination address register start address of transfer destination incremented/decremented every transfer, or fixed 0 etcrah 7 holds block size block size fixed 0 etcral 7 block size counter block size decremented every transfer; etcrh value copied when count reaches h'00 15 0 etcrb block transfer counter number of block transfers decremented every block transfer; transfer ends when count reaches h'0000 mara and marb specify the start addresses of the transfer source and transfer destination, respectively, as 24 bits. mar can be incremented or decremented by 1 or 2 each time a byte or word is transferred, or can be fixed. incrementing, decrementing, or holding a fixed value can be set separately for mara and marb. whether a block is to be designated for mara or for marb is specified by the blkdir bit in dmacra. to specify the number of transfers, if m is the size of one block (where m = 1 to 256) and n transfers are to be performed (where n = 1 to 65,536), m is set in both etcrah and etcral, and n in etcrb. figure 8.14 illustrates operation in block transfer mode when marb is designated as a block area.
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 252 of 982 rej09b0054-0500 address t a address b a transfer address t b address b b 1st block 2nd block nth block block area consecutive transfer of m bytes or words is performed in response to one request legend: address address address address where : = l a = l b = l a + saide ( 1) said (2 dtsz (m n 1)) = l b + daide ( 1) daid (2 dtsz (n 1)) = value set in mara = value set in marb = value set in etcrb = value set in etcrah and etcral t a t b b a b b l a l b n m figure 8.14 operation in block transfer mode (blkdir = 0)
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 253 of 982 rej09b0054-0500 figure 8.15 illustrates operation in block transfer mode when mara is designated as a block area. address t b address b b transfer address t a address b a 1st block 2nd block nth block block area consecutive transfer of m bytes or words is performed in response to one request legend: address address address address where : = l a = l b = l a + saide ( 1) said (2 dtsz (n 1)) = l b + daide ( 1) daid (2 dtsz (m n 1)) = value set in mara = value set in marb = value set in etcrb = value set in etcrah and etcral t a t b b a b b l a l b n m figure 8.15 operation in block transfer mode (blkdir = 1) etcral is decremented by 1 each time a byte or word transfer is performed. in response to a single transfer request, burst transfer is performed until the value in etcral reaches h'00. etcral is then loaded with the value in etcrah. at this time, the value in the mar register for which a block designation has been given by the blkdir bit in dmacra is restored in accordance with the dtsz, said/daid, and saide/daide bits in dmacr.
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 254 of 982 rej09b0054-0500 etcrb is decremented by 1 after every block transfer, and when the count reaches h'0000 the dte bit in dmabcrl is cleared and transfer ends. if the dtie bit in dmabcrl is set to 1 at this point, an interrupt request is sent to the cpu or dtc. figure 8.16 shows the operation flow in block transfer mode. acquire bus etcral = etcral 1 transfer request? etcral = h'00 release bus blkdir = 0 etcral = etcrah etcrb = etcrb 1 etcrb = h'0000 start (dte = dtme = 1) read address specified by mara mara = mara + saide ( 1) said 2 dtsz write to address specified by marb marb = marb + daide ( 1) daid 2 dtsz marb = marb daide ( 1) daid 2 dtsz etcrah mara = mara saide ( 1) said 2 dtsz etcrah no yes no yes no yes no yes clear dte bit to 0 to end transfer figure 8.16 operation flow in block transfer mode
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 255 of 982 rej09b0054-0500 transfer requests (activation sources) consist of a/d converter conversion end interrupts, external requests, sci transmit-data-empty and receive-data-full interrupts, and tpu channel 0 to 5 compare match/input capture a interrupts. figure 8.17 shows an example of the setting procedure for block transfer mode. block transfer mode setting set dmabcrh set transfer source and transfer destination addresses set number of transfers set dmacr read dmabcrl set dmabcrl block transfer mode [1] [2] [3] [4] [5] [6] [1] set each bit in dmabcrh. set the fae bit to 1 to select full address mode. specify enabling or disabling of internal interrupt clearing with the dta bit. [2] set the transfer source address in mara, and the transfer destination address in marb. [3] set the block size in both etcrah and etcral. set the number of transfers in etcrb. [4] set each bit in dmacra and dmacrb. set the transfer data size with the dtsz bit. specify whether mara is to be incremented, decremented, or fixed, with the said and saide bits. set the blke bit to 1 to select block transfer mode. specify whether the transfer source or the transfer destination is a block area with the blkdir bit. specify whether marb is to be incremented, decremented, or fixed, with the daid and daide bits. select the activation source with bits dtf3 to dtf0. [5] read dte = 0 and dtme = 0 in dmabcrl. [6] set each bit in dmabcrl. specify enabling or disabling of transfer end interrupts to the cpu with the dtie bit. set both the dtme bit and the dte bit to 1 to enable transfer. figure 8.17 example of block transfer mode setting procedure
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 256 of 982 rej09b0054-0500 8.5.8 basic bus cycles an example of the basic dmac bus cycle timing is shown in figure 8.18. in this example, word- size transfer is performed from 16-bit, 2-state access space to 8-bit, 3-state access space. when the bus is transferred from the cpu to the dmac, a source address read and destination address write are performed. the bus is not released in response to another bus request, etc., between these read and write operations. as like cpu cycles, dma cycles conform to the bus controller settings. the address is not output to the external address bus in an access to on-chip memory or an internal i/o register. address bus dmac cycle (1-word transfer) rd lwr hwr source address destination address cpu cycle cpu cycle t 1 t 2 t 3 t 1 t 2 t 3 t 1 t 2 figure 8.18 example of dma transfer bus timing
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 257 of 982 rej09b0054-0500 8.5.9 dma transfer (dual address mode) bus cycles short address mode: figure 8.19 shows a transfer example in which tend output is enabled and byte-size short address mode transfer (sequential/idle/repeat mode) is performed from external 8-bit, 2-state access space to internal i/o space. dma read address bus rd lwr tend hwr bus release last transfer cycle dma write dma dead dma read dma write dma read dma write bus release bus release bus release figure 8.19 example of short address mode transfer a byte or word transfer is performed for a single transfer request, and after the transfer, the bus is released. while the bus is released, one or more bus cycles are executed by the cpu or dtc. in the transfer end cycle (the cycle in which the transfer counter reaches 0), a one-state dma dead cycle is inserted after the dma write cycle. in repeat mode, when tend output is enabled, tend output goes low in the transfer end cycle. full address mode (cycle steal mode): figure 8.20 shows a transfer example in which tend output is enabled and word-size full address mode transfer (cycle steal mode) is performed from external 16-bit, 2-state access space to external 16-bit, 2-state access space.
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 258 of 982 rej09b0054-0500 dma read address bus rd lwr tend hwr bus release last transfer cycle dma write dma read dma write dma read dma write dma dead bus release bus release bus release figure 8.20 example of full address mode transfer (cycle steal) a byte or word transfer is performed for a single transfer request, and after the transfer, the bus is released. while the bus is released, one bus cycle is executed by the cpu or dtc. in the transfer end cycle (the cycle in which the transfer counter reaches 0), a one-state dma dead cycle is inserted after the dma write cycle. full address mode (burst mode): figure 8.21 shows a transfer example in which tend output is enabled and word-size full address mode transfer (burst mode) is performed from external 16- bit, 2-state access space to external 16-bit, 2-state access space.
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 259 of 982 rej09b0054-0500 dma read address bus rd lwr tend hwr bus release dma write dma dead dma read dma write dma read dma write bus release burst transfer last transfer cycle figure 8.21 example of full address mode transfer (burst mode) in burst mode, one-byte or one-word transfers are executed consecutively until transfer ends. in the transfer end cycle (the cycle in which the transfer counter reaches 0), a one-state dma dead cycle is inserted after the dma write cycle. if a request from another higher-priority channel is generated after burst transfer starts, that channel has to wait until the burst transfer ends. if an nmi interrupt is generated while a channel designated for burst transfer is in the transfer enabled state, the dtme bit in dmabcrl is cleared and the channel is placed in the transfer disabled state. if burst transfer has already been activated inside the dmac, the bus is released on completion of a one-byte or one-word transfer within the burst transfer, and burst transfer is suspended. if the last transfer cycle of the burst transfer has already been activated inside the dmac, execution continues to the end of the transfer even if the dtme bit is cleared. full address mode (block transfer mode): figure 8.22 shows a transfer example in which tend output is enabled and word-size full address mode transfer (block transfer mode) is performed from internal 16-bit, 1-state access space to external 16-bit, 2-state access space.
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 260 of 982 rej09b0054-0500 dma read address bus rd lwr tend hwr bus release block transfer last block transfer dma write dma read dma write dma dead dma read dma write dma read dma write dma dead bus release bus release figure 8.22 example of full address mode transfer (block transfer mode) a one-block transfer is performed for a single transfer request, and after the transfer the bus is released. while the bus is released, one or more bus cycles are executed by the cpu or dtc. in the transfer end cycle of each block (the cycle in which the transfer counter reaches 0), a one- state dma dead cycle is inserted after the dma write cycle. even if an nmi interrupt is generated during data transfer, block transfer operation is not affected until data transfer for one block has ended. dreq dreq dreq dreq pin falling edge activation timing: set the dta bit in dmabcrh to 1 for the channel for which the dreq pin is selected.
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 261 of 982 rej09b0054-0500 figure 8.23 shows an example of normal mode transfer activated by the dreq pin falling edge. dma read address bus dreq idle write idle bus release dma control channel write idle transfer source request [1] [3] [2] [4] [6] [5] [7] acceptance resumes acceptance resumes dma write bus release dma read dma write bus release request transfer destination transfer source transfer destination read read request clear period request clear period minimum of 2 cycles minimum of 2 cycles [1] acceptance after transfer enabling; the dreq pin low level is sampled on the rising edge of , and the request is held. [2] [5] the request is cleared at the next bus break, and activation is started in the dmac. [3] [6] start of dma cycle; dreq pin high level sampling on the rising edge of starts. [4] [7] when the dreq pin high level has been sampled, acceptance is resumed after the write cycle is completed. (as in [1], the dreq pin low level is sampled on the rising edge of , and the request is held.) note: in write data buffer mode, bus breaks from [2] to [7] may be hidden, and not visible. figure 8.23 example of dreq dreq dreq dreq pin falling edge activated normal mode transfer dreq pin sampling is performed every cycle, with the rising edge of the next cycle after the end of the dmabcr write cycle for setting the transfer enabled state as the starting point. when the dreq pin low level is sampled while acceptance by means of the dreq pin is possible, the request is held in the dmac. then, when activation is initiated in the dmac, the request is cleared, and dreq pin high level sampling for edge detection is started. if dreq pin high level sampling has been completed by the time the dma write cycle ends, acceptance resumes after the end of the write cycle, dreq pin low level sampling is performed again, and this operation is repeated until the transfer ends.
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 262 of 982 rej09b0054-0500 figure 8.24 shows an example of block transfer mode transfer activated by the dreq pin falling edge. dma read address bus dreq idle write bus release dma control channel write transfer source request [1] [3] [2] [4] [6] [5] [7] acceptance resumes dma dead 1 block transfer idle dead dead dma write bus release dma read dma write dma dead bus release transfer source request acceptance resumes 1 block transfer transfer destination transfer destination read idle read minimum of 2 cycles minimum of 2 cycles request clear period request clear period [1] acceptance after transfer enabling; the dreq pin low level is sampled on the rising edge of , and the request is held. [2] [5] the request is cleared at the next bus break, and activation is started in the dmac. [3] [6] start of dma cycle; dreq pin high level sampling on the rising edge of starts. [4] [7] when the dreq pin high level has been sampled, acceptance is resumed after the dead cycle is completed. (as in [1], the dreq pin low level is sampled on the rising edge of , and the request is held.) note: in write data buffer mode, bus breaks from [2] to [7] may be hidden, and not visible. figure 8.24 example of dreq dreq dreq dreq pin falling edge activated block transfer mode transfer dreq pin sampling is performed every cycle, with the rising edge of the next cycle after the end of the dmabcr write cycle for setting the transfer enabled state as the starting point. when the dreq pin low level is sampled while acceptance by means of the dreq pin is possible, the request is held in the dmac. then, when activation is initiated in the dmac, the request is cleared, and dreq pin high level sampling for edge detection is started. if dreq pin high level sampling has been completed by the time the dma dead cycle ends, acceptance resumes after the end of the dead cycle, dreq pin low level sampling is performed again, and this operation is repeated until the transfer ends.
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 263 of 982 rej09b0054-0500 dreq dreq dreq dreq pin low level activation timing (normal mode): set the dta bit in dmabcrh to 1 for the channel for which the dreq pin is selected. figure 8.25 shows an example of normal mode transfer activated by the dreq pin low level. dma read dma write address bus dreq idle write idle bus release dma control channel write idle transfer source bus release dma read dma write bus release request [1] [3] [2] [4] [6] [5] [7] acceptance resumes acceptance resumes transfer destination transfer source transfer destination request request clear period request clear period read read minimum of 2 cycles minimum of 2 cycles [1] acceptance after transfer enabling; the dreq pin low level is sampled on the rising edge of , and the request is held. [2] [5] the request is cleared at the next bus break, and activation is started in the dmac. [3] [6] the dma cycle is started. [4] [7] acceptance is resumed after the write cycle is completed. (as in [1], the dreq pin low level is sampled on the rising edge of , and the request is held.) note: in write data buffer mode, bus breaks from [2] to [7] may be hidden, and not visible. figure 8.25 example of dreq dreq dreq dreq pin low level activated normal mode transfer dreq pin sampling is performed every cycle, with the rising edge of the next cycle after the end of the dmabcr write cycle for setting the transfer enabled state as the starting point. when the dreq pin low level is sampled while acceptance by means of the dreq pin is possible, the request is held in the dmac. then, when activation is initiated in the dmac, the request is cleared. after the end of the write cycle, acceptance resumes, dreq pin low level sampling is performed again, and this operation is repeated until the transfer ends.
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 264 of 982 rej09b0054-0500 figure 8.26 shows an example of block transfer mode transfer activated by dreq pin low level. dma read dma write address bus dreq idle write bus release dma control channel write transfer source request [1] [3] [2] [4] [6] [5] [7] acceptance resumes dma dead bus release dma read dma write dma dead bus release 1 block transfer idle dead dead 1 block transfer acceptance resumes request minimum of 2 cycles minimum of 2 cycles transfer source read request clear period read request clear period transfer destination transfer destination idle [1] acceptance after transfer enabling; the dreq pin low level is sampled on the rising edge of , and the request is held. [2] [5] the request is cleared at the next bus break, and activation is started in the dmac. [3] [6] the dma cycle is started. [4] [7] acceptance is resumed after the dead cycle is completed. (as in [1], the dreq pin low level is sampled on the rising edge of , and the request is held.) note: in write data buffer mode, bus breaks from [2] to [7] may be hidden, and not visible. figure 8.26 example of dreq dreq dreq dreq pin low level activated block transfer mode transfer dreq pin sampling is performed every cycle, with the rising edge of the next cycle after the end of the dmabcr write cycle for setting the transfer enabled state as the starting point. when the dreq pin low level is sampled while acceptance by means of the dreq pin is possible, the request is held in the dmac. then, when activation is initiated in the dmac, the request is cleared. after the end of the dead cycle, acceptance resumes, dreq pin low level sampling is performed again, and this operation is repeated until the transfer ends.
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 265 of 982 rej09b0054-0500 8.5.10 dma transfer (single address mode) bus cycles single address mode (read): figure 8.27 shows a transfer example in which tend output is enabled and byte-size single address mode transfer (read) is performed from external 8-bit, 2-state access space to an external device. dma read address bus dma dead rd dack tend bus release dma read dma read dma read bus release bus release bus release bus release last transfer cycle figure 8.27 example of single address mode transfer (byte read)
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 266 of 982 rej09b0054-0500 figure 8.28 shows a transfer example in which tend output is enabled and word-size single address mode transfer (read) is performed from external 8-bit, 2-state access space to an external device. dma read address bus dma read dma read dma dead rd tend dack bus release bus release bus release bus release last transfer cycle figure 8.28 example of single address mode (word read) transfer a byte or word transfer is performed for a single transfer request, and after the transfer, the bus is released. while the bus is released, one or more bus cycles are executed by the cpu or dtc. in the transfer end cycle (the cycle in which the transfer counter reaches 0), a one-state dma dead cycle is inserted after the dma write cycle.
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 267 of 982 rej09b0054-0500 single address mode (write): figure 8.29 shows a transfer example in which tend output is enabled and byte-size single address mode transfer (write) is performed from an external device to external 8-bit, 2-state access space. dma write address bus dma dead hwr dack tend bus release lwr dma write dma write dma write bus release bus release bus release bus release last transfer cycle figure 8.29 example of single address mode transfer (byte write)
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 268 of 982 rej09b0054-0500 figure 8.30 shows a transfer example in which tend output is enabled and word-size single address mode transfer (write) is performed from an external device to external 8-bit, 2-state access space. dma write address bus dma write dma write dma dead hwr tend dack bus release lwr bus release bus release bus release last transfer cycle figure 8.30 example of s i ngle address mode transfer (word write) a byte or word transfer is performed for a single transfer request, and after the transfer, the bus is released. while the bus is released, one or more bus cycles are executed by the cpu or dtc. in the transfer end cycle (the cycle in which the transfer counter reaches 0), a one-state dma dead cycle is inserted after the dma write cycle. dreq dreq dreq dreq pin falling edge activation timing: set the dta bit in dmabcrh to 1 for the channel for which the dreq pin is selected.
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 269 of 982 rej09b0054-0500 figure 8.31 shows an example of single address mode transfer activated by the dreq pin falling edge. dreq bus release dma single dma single address bus dma control channel [2] dack transfer source/ destination idle idle idle [1] [3] [5] [4] [6] [7] acceptance resumes acceptance resumes bus release bus release transfer source/ destination request request request clear period request clear period minimum of 2 cycles minimum of 2 cycles single single [1] acceptance after transfer enabling; the dreq pin low level is sampled on the rising edge of , and the request is held. [2] [5] the request is cleared at the next bus break, and activation is started in the dmac. [3] [6] start of dma cycle; dreq pin high level sampling on the rising edge of starts. [4] [7] when the dreq pin high level has been sampled, acceptance is resumed after the single cycle is completed. (as in [1], the dreq pin low level is sampled on the rising edge of , and the request is held.) note: in write data buffer mode, bus breaks from [2] to [7] may be hidden, and not visible. figure 8.31 example of dreq dreq dreq dreq pin falling edge activated single address mode transfer dreq pin sampling is performed every cycle, with the rising edge of the next cycle after the end of the dmabcr write cycle for setting the transfer enabled state as the starting point. when the dreq pin low level is sampled while acceptance by means of the dreq pin is possible, the request is held in the dmac. then, when activation is initiated in the dmac, the request is cleared, and dreq pin high level sampling for edge detection is started. if dreq pin high level sampling has been completed by the time the dma single cycle ends, acceptance
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 270 of 982 rej09b0054-0500 resumes after the end of the single cycle, dreq pin low level sampling is performed again, and this operation is repeated until the transfer ends. dreq dreq dreq dreq pin low level activation timing: set the dta bit in dmabcrh to 1 for the channel for which the dreq pin is selected. figure 8.32 shows an example of single address mode transfer activated by the dreq pin low level. dreq bus release dma single address bus dma control channel [2] dack transfer source/ destination idle idle idle [1] [3] [5] [4] [6] [7] acceptance resumes acceptance resumes bus release dma single bus release transfer source/ destination request request request clear period request clear period single single minimum of 2 cycles minimum of 2 cycles [1] acceptance after transfer enabling; the dreq pin low level is sampled on the rising edge of , and the request is held. [2] [5] the request is cleared at the next bus break, and activation is started in the dmac. [3] [6] the dmac cycle is started. [4] [7] acceptance is resumed after the single cycle is completed. (as in [1], the dreq pin low level is sampled on the rising edge of , and the request is held.) note: in write data buffer mode, bus breaks from [2] to [7] may be hidden, and not visible. figure 8.32 example of dreq dreq dreq dreq pin low level activated single address mode transfer
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 271 of 982 rej09b0054-0500 dreq pin sampling is performed every cycle, with the rising edge of the next cycle after the end of the dmabcr write cycle for setting the transfer enabled state as the starting point. when the dreq pin low level is sampled while acceptance by means of the dreq pin is possible, the request is held in the dmac. then, when activation is initiated in the dmac, the request is cleared. after the end of the single cycle, acceptance resumes, dreq pin low level sampling is performed again, and this operation is repeated until the transfer ends. 8.5.11 multi-channel operation the dmac channel priority order is: channel 0 > channel 1, and channel a > channel b. table 8.11 summarizes the priority order for dmac channels. table 8.11 dmac channel priority order short address mode full address mode priority channel 0a channel 0 high channel 0b channel 1a channel 1 channel 1b low if transfer requests are issued simultaneously for more than one channel, or if a transfer request for another channel is issued during a transfer, when the bus is released, the dmac selects the highest-priority channel from among those issuing a request according to the priority order shown in table 8.11. during burst transfer, or when one block is being transferred in block transfer, the channel will not be changed until the end of the transfer. figure 8.33 shows a transfer example in which transfer requests are issued simultaneously for channels 0a, 0b, and 1.
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 272 of 982 rej09b0054-0500 dma read dma write dma read dma write dma read dma write dma read address bus rd hwr lwr dma control channel 0a channel 0b channel 1 idle write idle read write idle read write read request hold request hold bus release channel 0a transfer bus release channel 0b transfer channel 1 transfer bus release request hold read selection non- selection selection request clear request clear request clear figure 8.33 example of multi-channel transfer 8.5.12 relation between dmac and external bus requests, and dtc the dma read cycle and write cycle are inseparable, and so the external bus release cycle and dtc cycle do not arise between the dma external read cycle and internal write cycle. when the read cycle and write cycle are set in series as in a burst transfer or block transfer, the external bus release may be inserted after the write cycle. as the dtc has a lower priority than the dmac, it is not executed until the dmac releases the bus. when the dma read cycle or write cycle accesses the on-chip memory or an internal i/o register, the dmac cycle or external bus release may be executed at the same time. 8.5.13 dmac and nmi interrupts when an nmi interrupt is requested, burst mode transfer in full address mode is interrupted. an nmi interrupt does not affect the operation of the dmac in other modes. in full address mode, transfer is enabled for a channel when both the dte bit and dtme bit are set to 1. with burst mode setting, the dtme bit is cleared when an nmi interrupt is requested.
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 273 of 982 rej09b0054-0500 if the dtme bit is cleared during burst mode transfer, the dmac discontinues transfer on completion of the 1-byte or 1-word transfer in progress, then releases the bus, which passes to the cpu. the channel on which transfer was interrupted can be restarted by setting the dtme bit to 1 again. figure 8.34 shows the procedure for continuing transfer when it has been interrupted by an nmi interrupt on a channel designated for burst mode transfer. resumption of transfer on interrupted channel set dtme bit to 1 transfer continues [1] [2] dte = 1 dtme = 0 transfer ends no yes [1] [2] check that dte = 1 and dtme = 0 in dmabcrl. write 1 to the dtme bit. figure 8.34 example of procedure for continuing transfer on channel interrupted by nmi interrupt 8.5.14 forced termination of dmac operation if the dte bit in dmabcrl is cleared to 0 for the channel currently operating, the dmac stops on completion of the 1-byte or 1-word transfer in progress. dmac operation resumes when the dte bit is set to 1 again. in full address mode, the same applies to the dtme bit in dmabcrl. figure 8.35 shows the procedure for forcibly terminating dmac operation by software.
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 274 of 982 rej09b0054-0500 forced termination of dmac clear dte bit to 0 forced termination [1] [1] clear the dte bit in dmabcrl to 0. to prevent interrupt generation after forced termination of dmac operation, clear the dtie bit to 0 at the same time. figure 8.35 example of procedure for forcibly terminating dmac operation 8.5.15 clearing full address mode figure 8.36 shows the procedure for releasing and initializing a channel designated for full address mode. after full address mode has been cleared, the channel can be set to another transfer mode using the appropriate setting procedure. clearing full address mode stop the channel initialize dmacr clear fae bit to 0 initialization; operation halted [1] [2] [3] [1] clear both the dte bit and dtme bit in dmabcrl to 0, or wait until the transfer ends and the dte bit is cleared to 0, then clear the dtme bit to 0. also clear the corresponding dtie bit to 0 at the same time. [2] clear all bits in dmacra and dmacrb to 0. [3] clear the fae bit in dmabcrh to 0. figure 8.36 example of procedure for clearing full address mode
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 275 of 982 rej09b0054-0500 8.6 interrupt sources the sources of interrupts generated by the dmac are transfer end and transfer break. table 8.12 shows the interrupt sources and their priority order. table 8.12 interrupt sources and priority order interrupt interrupt source interrupt name short address mode full address mode priority order dend0a interrupt due to end of transfer on channel 0a interrupt due to end of transfer on channel 0 high dend0b interrupt due to end of transfer on channel 0b interrupt due to break in transfer on channel 0 dend1a interrupt due to end of transfer on channel 1a interrupt due to end of transfer on channel 1 dend1b interrupt due to end of transfer on channel 1b interrupt due to break in transfer on channel 1 low enabling or disabling of each interrupt source is set by means of the dtie bit in dmabcrl for the corresponding channel in dmabcrl, and interrupts from each source are sent to the interrupt controller independently. the priority of transfer end interrupts on each channel is decided by the interrupt controller, as shown in table 8.12. figure 8.37 shows a block diagram of a transfer end/transfer break interrupt. an interrupt is always generated when the dtie bit is set to 1 while the dte bit in dmabcrl is cleared to 0. dte/ dtme dtie transfer end/transfer break interrupt figure 8.37 block diagram of transfer end/transfer break interrupt in full address mode, a transfer break interrupt is generated when the dtme bit is cleared to 0 while the dtie bit is set to 1. in both short address mode and full address mode, dmabcr should be set so as to prevent the occurrence of a combination that constitutes a condition for interrupt generation during setting.
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 276 of 982 rej09b0054-0500 8.7 usage notes 8.7.1 dmac register access during operation except for forced termination of the dmac, the operating (including transfer waiting state) channel setting should not be changed. the operating channel setting should only be changed when transfer is disabled. also, dmac registers should not be written to in a dma transfer. dmac register reads during operation (including the transfer waiting state) are described below. ? dmac control starts one cycle before the bus cycle, with output of the internal address. consequently, mar is updated in the bus cycle before dma transfer. figure 8.38 shows an example of the update timing for dmac registers in dual address transfer mode. [1] transfer source address register mar operation (incremented/decremented/fixed) transfer counter etcr operation (decremented) block size counter etcr operation (decremented in block transfer mode) [2] transfer destination address register mar operation (incremented/decremented/fixed) [2'] transfer destination address register mar operation (incremented/decremented/fixed) block transfer counter etcr operation (decremented, in last transfer cycle of a block in block transfer mode) [3] transfer address register mar restore operation (in block or repeat transfer mode) transfer counter etcr restore (in repeat transfer mode) block size counter etcr restore (in block transfer mode) note: in single address transfer mode, the update timing is the same as [1]. the mar operation is post-incrementing/decrementing of the dma internal address value. [1] dma transfer cycle dma read dma read dma write dma write dma dead dma internal address dma control dma register operation dma last transfer cycle transfer destination transfer destination transfer source transfer source idle idle idle read read dead write write [2] [1] [2'] [3] figure 8.38 dmac register update timing
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 277 of 982 rej09b0054-0500 ? if a dmac transfer cycle occurs immediately after a dmac register read cycle, the dmac register is read as shown in figure 8.39. [1] [2] note: the lower word of mar is the updated value after the operation in [1]. cpu longword read dma transfer cycle mar upper word read mar lower word read dma read dma write dma internal address dma control dma register operation transfe source transfer destination idle read write idle figure 8.39 contention between dmac register update and cpu read 8.7.2 module stop when the mstpa7 bit in mstpcra is set to 1, the dmac clock stops, and the module stop state is entered. however, 1 cannot be written to the mstpa7 bit if any of the dmac channels is enabled. this setting should therefore be made when dmac operation is stopped. when the dmac clock stops, dmac register accesses can no longer be made. since the following dmac register settings are valid even in the module stop state, they should be invalidated, if necessary, before a module stop. ? transfer end/break interrupt (dte = 0 and dtie = 1) ? tend pin enable (tee = 1) ? dack pin enable (fae = 0 and sae = 1) 8.7.3 medium-speed mode when the dta bit is cleared to 0, the internal interrupt signal that is specified for the dmac transfer source is detected at the edge. in medium-speed mode, the dmac operates by the medium-speed clock and the internal peripheral module operates by the high-speed clock. therefore, when the corresponding interruption source is cleared by the cpu, dtc, or other channels of the dmac and the period until the next interruption is executed is less than one state regarding to the dmac clock (bus master clock), the signal is not detected at the edge and ignored.
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 278 of 982 rej09b0054-0500 in medium-speed mode, the dreq pin is sampled at the rising edge of the medium clock. 8.7.4 activation by falling edge on dreq dreq dreq dreq pin dreq pin falling edge detection is performed in synchronization with dmac internal operations. the operation is as follows: [1] activation request wait state: waits for detection of a low level on the dreq pin, and switches to [2]. [2] transfer wait state: waits for dmac data transfer to become possible, and switches to [3]. [3] activation request disabled state: waits for detection of a high level on the dreq pin, and switches to [1]. after dmac transfer is enabled, a transition is made to [1]. thus, initial activation after transfer is enabled is performed on detection of a low level. 8.7.5 activation source acceptance at the start of activation source acceptance, a low level is detected in both dreq pin falling edge sensing and low level sensing. similarly, in the case of an internal interrupt, the interrupt request is detected. therefore, a request is accepted from an internal interrupt or dreq pin low level that occurs before write to dmabcrl to enable transfer. when the dmac is activated, take any necessary steps to prevent an internal interrupt or dreq pin low level remaining from the end of the previous transfer, etc. 8.7.6 internal interrupt after end of transfer when the dte bit in dmabcrl is cleared to 0 at the end of a transfer or by a forcible termination, the selected internal interrupt request will be sent to the cpu or dtc even if the dta bit in dmabcrh is set to 1. also, if internal dmac activation has already been initiated when operation is forcibly terminated, the transfer is executed but flag clearing is not performed for the selected internal interrupt even if the dta bit is set to 1. an internal interrupt request following the end of transfer or a forcible termination should be handled by the cpu as necessary.
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 279 of 982 rej09b0054-0500 8.7.7 channel re-setting to reactivate a number of channels when multiple channels are enabled, use exclusive handling of transfer end interrupts, and perform dmabcr control bit operations exclusively. note, in particular, that in cases where multiple interrupts are generated between reading and writing of dmabcr, and a dmabcr operation is performed during new interrupt handling, the dmabcr write data in the original interrupt handling routine will be incorrect, and the write may invalidate the results of the operations by the multiple interrupts. ensure that overlapping dmabcr operations are not performed by multiple interrupts, and that there is no separation between read and write operations by the use of a bit-manipulation instruction. also, when the dte and dtme bits are cleared by the dmac or are written with 0, they must first be read while cleared to 0 before the cpu can write 1 to them.
section 8 dma controller (dmac) rev. 5.00 aug 08, 2006 page 280 of 982 rej09b0054-0500
section 9 data transfer controller (dtc) rev. 5.00 aug 08, 2006 page 281 of 982 rej09b0054-0500 section 9 data transfer controller (dtc) this lsi includes a data transfer controller (dtc). the dtc can be activated by an interrupt or software, to transfer data. figure 9.1 shows a block diagram of the dtc. the dtc?s register information is stored in the on-chip ram. when the dtc is used, the rame bit in syscr must be set to 1. a 32-bit bus connects the dtc to the on-chip ram (1 kbyte), enabling 32-bit/1-state reading and writing of the dtc register information. 9.1 features ? transfer is possible over any number of channels ? three transfer modes normal, repeat, and block transfer modes are available ? one activation source can trigger a number of data transfers (chain transfer) ? the direct specification of 16-mbyte address space is possible ? activation by software is possible ? transfer can be set in byte or word units ? a cpu interrupt can be requested for the interrupt that activated the dtc ? module stop mode can be set
section 9 data transfer controller (dtc) rev. 5.00 aug 08, 2006 page 282 of 982 rej09b0054-0500 internal address bus dtcera to dtcerg and dtceri interrupt controller interrupt request dtc on-chip ram internal data bus cpu interrupt request mra mrb cra crb dar sar mra, mrb: cra, crb: sar: dar: dtcera to dtcerg and dtceri: dtvecr: dtc mode registers a and b dtc transfer count registers a and b dtc source address register dtc destination address register dtc enable registers a to g and i dtc vector register legend: dtc service request control logic register information dtvecr figure 9.1 block diagram of dtc 9.2 register descriptions the dtc has the following registers. ? dtc mode register a (mra) ? dtc mode register b (mrb) ? dtc source address register (sar) ? dtc destination address register (dar) ? dtc transfer count register a (cra) ? dtc transfer count register b (crb) these six registers cannot be directly accessed from the cpu. when activated, the dtc reads a set of register information that is stored in on-chip ram to the corresponding dtc registers and transfers data. after the data transfer, it writes a set of updated register information back to the ram.
section 9 data transfer controller (dtc) rev. 5.00 aug 08, 2006 page 283 of 982 rej09b0054-0500 ? dtc enable registers a to g, and i (dtcera to dtcerg, and dtceri) ? dtc vector register (dtvecr) 9.2.1 dtc mode register a (mra) mra selects the dtc operating mode.
section 9 data transfer controller (dtc) rev. 5.00 aug 08, 2006 page 284 of 982 rej09b0054-0500 bit bit name initial value r/w description 7 6 sm1 sm0 undefined undefined ? ? source address mode 1 and 0 these bits specify an sar operation after a data transfer. 0 : sar is fixed 10: sar is incremented after a transfer (by +1 when sz = 0; by +2 when sz = 1) 11: sar is decremented after a transfer (by ?1 when sz = 0; by ?2 when sz = 1) 5 4 dm1 dm0 undefined undefined ? ? destination address mode 1 and 0 these bits specify a dar operation after a data transfer. 0 : dar is fixed 10: dar is incremented after a transfer (by +1 when sz = 0; by +2 when sz = 1) 11: dar is decremented after a transfer (by ?1 when sz = 0; by ?2 when sz = 1) 3 2 md1 md0 undefined undefined ? ? dtc mode 1 and 0 these bits specify the dtc transfer mode. 00: normal mode 01: repeat mode 10: block transfer mode 11: setting prohibited 1 dts undefined ? dtc transfer mode select specifies whether the source side or the destination side is set to be a repeat area or block area, in repeat mode or block transfer mode. 0: destination side is repeat area or block area 1: source side is repeat area or block area 0 sz undefined ? dtc data transfer size specifies the size of data to be transferred. 0: byte-size transfer 1: word-size transfer legend: : don?t care
section 9 data transfer controller (dtc) rev. 5.00 aug 08, 2006 page 285 of 982 rej09b0054-0500 9.2.2 dtc mode register b (mrb) mrb is an 8-bit register that selects the dtc operating mode. bit bit name initial value r/w description 7 chne undefined ? dtc chain transfer enable this bit specifies a chain transfer. for details, refer to section 9.5.4, chain transfer. in data transfer with chne set to 1, determination of the end of the specified number of transfers, clearing of the interrupt source flag, and clearing of dtcer, are not performed. 0: dtc data transfer completed (waiting for start) 1: dtc chain transfer (reads new register information and transfers data) 6 disel undefined ? dtc interrupt select this bit specifies whether cpu interrupt is disabled or enabled after a data transfer. 0: interrupt request is issued to the cpu when the specified data transfer is completed 1: dtc issues interrupt request to the cpu in every data transfer (dtc does not clear the interrupt request flag that is a cause of the activation) 5 to 0 ? undefined ? reserved these bits have no effect on dtc operation. the write value should always be 0. 9.2.3 dtc source address register (sar) sar is a 24-bit register that designates the source address of data to be transferred by the dtc. for word-size transfer, specify an even source address. 9.2.4 dtc destination address register (dar) dar is a 24-bit register that designates the destination address of data to be transferred by the dtc. for word-size transfer, specify an even destination address.
section 9 data transfer controller (dtc) rev. 5.00 aug 08, 2006 page 286 of 982 rej09b0054-0500 9.2.5 dtc transfer count register a (cra) cra is a 16-bit register that designates the number of times data is to be transferred by the dtc. in normal mode, the entire cra functions as a 16-bit transfer counter (1 to 65,536). it is decremented by 1 every time data is transferred, and transfer ends when the count reaches h'0000. in repeat mode or block transfer mode, the cra is divided into two parts; the upper 8 bits (crah) and the lower 8 bits (cral). crah holds the number of transfers while cral functions as an 8-bit transfer counter (1 to 256). cral is decremented by 1 every time data is transferred, and the contents of crah are sent when the count reaches h'00. 9.2.6 dtc transfer count register b (crb) crb is a 16-bit register that designates the number of times data is to be transferred by the dtc in block transfer mode. it functions as a 16-bit transfer counter (1 to 65,536) that is decremented by 1 every time data is transferred, and transfer ends when the count reaches h'0000. 9.2.7 dtc enable registers a to g, and i (dtcera to dtcerg, and dtceri) dtcer is a set of registers to specify the dtc activation interrupt source, and comprised of eight registers; dtcera to dtcerg, and dtceri. the correspondence between interrupt sources and dtce bits, and vector numbers generated by the interrupt controller are shown in table 9.2. for dtce bit setting, use bit manipulation instructions such as bset and bclr for reading and writing. when multiple activation sources are to be set at one time, only at the initial setting, writing data is enabled after executing a dummy read on the relevant register with all the interrupts being masked.
section 9 data transfer controller (dtc) rev. 5.00 aug 08, 2006 page 287 of 982 rej09b0054-0500 bit bit name initial value r/w description 7 6 5 4 3 2 1 0 dtcen7 dtcen6 dtcen5 dtcen4 dtcen3 dtcen2 dtcen1 dtcen0 0 0 0 0 0 0 0 0 r/w r/w r/w r/w r/w r/w r/w r/w dtc activation enable 0: disables an interrupt for dtc activation. 1: specifies a relevant interrupt source as a dtc activation source. [clearing conditions] ? when the disel bit in mrb is 1 and the data transfer has ended ? when the specified number of transfers have ended [retaining condition] when the disel bit is 0 and the specified number of transfers have not been completed note: n = a to g, and i
section 9 data transfer controller (dtc) rev. 5.00 aug 08, 2006 page 288 of 982 rej09b0054-0500 9.2.8 dtc vector register (dtvecr) dtvecr is an 8-bit readable/writable register that enables or disables dtc activation by software, and sets a vector number for the software activation interrupt. bit bit name initial value r/w description 7 swdte 0 r/w dtc software activation enable enables or disables the dtc software activation. 0: disables the dtc software activation. 1: enables the dtc software activation. [clearing conditions] ? when the disel bit is 0 and the specified number of transfers have not ended ? when 0 is written to the disel bit after a software-activated data transfer end interrupt (swdtend) request has been sent to the cpu. [retaining conditions] ? when the disel bit is 1 and data transfer has ended ? when the specified number of transfers have ended ? when the software-activated data transfer is in process 6 5 4 3 2 1 0 dtvec6 dtvec5 dtvec4 dtvec3 dtvec2 dtvec1 dtvec0 0 0 0 0 0 0 0 r/w r/w r/w r/w r/w r/w r/w dtc software activation vectors 0 to 6 these bits specify a vector number for dtc software activation. the vector address is expressed as h'0400 + (vector number 2). for example, when dtvec6 to dtvec0 = h'10, the vector address is h'0420. these bits are writable when swdte = 0.
section 9 data transfer controller (dtc) rev. 5.00 aug 08, 2006 page 289 of 982 rej09b0054-0500 9.3 activation sources the dtc operates when activated by an interrupt or by a write to dtvecr by software. an interrupt request can be directed to the cpu or dtc, as designated by the corresponding dtcer bit. at the end of a data transfer (or the last consecutive transfer in the case of chain transfer), the activation source or corresponding dtcer bit is cleared. the activation source flag, in the case of rxi0, for example, is the rdrf flag of sci_0. as there are a number of activation sources, the activation source flag is not cleared with the last byte (or word) transfer. take appropriate measures at each interrupt as shown in table 9.1, activation source and dtcer clearance. table 9.1 activation source and dtcer clearance activation source when the disel bit is 0 and the specified number of transfers have not ended when the disel bit is 1,or when the specified number of transfers have ended software activation ? the swdte bit is cleared to 0 ? the swdte bit remains set to 1 ? an interrupt is issued to the cpu interrupt activation ? the corresponding dtcer bit remains set to 1 ? the activation source flag is cleared to 0 ? the corresponding dtcer bit is cleared to 0 ? the activation source flag remains set to 1 ? a request is issued to the cpu for the activation source interrupt when an interrupt has been designated a dtc activation source, the existing cpu mask level and interrupt controller priorities have no effect. if there is more than one activation source at the same time, the dtc operates in accordance with the default priorities. figure 9.2 shows a block diagram of activation source control. for details, see section 5, interrupt controller.
section 9 data transfer controller (dtc) rev. 5.00 aug 08, 2006 page 290 of 982 rej09b0054-0500 cpu dtc dtcer source flag cleared on-chip peripheral module irq interrupt interrupt request clear clear controller clear request interrupt controller selection circuit interrupt mask select dtvecr figure 9.2 block diagram of dtc activation source control 9.4 location of register information and dtc vector table locate the register information in the on-chip ram (addresses: h'ffebc0 to h'ffefbf). register information should be located at an address that is a multiple of four within the range. locating the register information in address space is shown in figure 9.3. locate the mra, sar, mrb, dar, cra, and crb registers, in that order, from the start address of the register information. in the case of chain transfer, register information should be located in consecutive areas as shown in figure 9.3, and the register information start address should be located at the vector address corresponding to the interrupt source. figure 9.4 shows the correspondence between dtc vector address and register information. the dtc reads the start address of the register information from the vector address set for each activation source, and then reads the register information from that start address. when the dtc is activated by software, the vector address is obtained from: h'0400 + (dtvecr[6:0] 2). for example, if dtvecr is h'10, the vector address is h'0420. the configuration of the vector address is the same in both normal* and advanced modes, a 2-byte unit being used in both cases. these two bytes specify the lower bits of the register information start address. note: * normal mode cannot be used in this lsi.
section 9 data transfer controller (dtc) rev. 5.00 aug 08, 2006 page 291 of 982 rej09b0054-0500 mra 0123 sar mrb dar cra crb mra sar mrb dar cra crb lower address 4 bytes register information register information for 2nd transfer in chain transfer register information start address chain transfer figure 9.3 the location of the dtc register information in the address space register information start address register information chain transfer dtc vector address figure 9.4 correspondence between dtc vector address and register information
section 9 data transfer controller (dtc) rev. 5.00 aug 08, 2006 page 292 of 982 rej09b0054-0500 table 9.2 interrupt sources, dtc vector addresses, and corresponding dtces interrupt source origin of interrupt source vector number dtc vector address dtce * 1 priority software write to dtvecr dtvecr h'0400 + vector number 2 ? high external pin irq0 16 h'0420 dtcea7 irq1 17 h'0422 dtcea6 irq2 18 h'0424 dtcea5 irq3 19 h'0426 dtcea4 irq4 20 h'0428 dtcea3 irq5 21 h'042a dtcea2 irq6 22 h'042c dtcea1 irq7 23 h'042e dtcea0 a/d converter adi (a/d conversion end) 28 h'0438 dtceb6 tgi0a 32 h'0440 dtceb5 tpu channel 0 tgi0b 33 h'0442 dtceb4 tgi0c 34 h'0444 dtceb3 tgi0d 35 h'0446 dtceb2 tgi1a 40 h'0450 dtceb1 tpu channel 1 tgi1b 41 h'0452 dtceb0 tgi2a 44 h'0458 dtcec7 tpu channel 2 tgi2b 45 h'045a dtcec6 tgi3a 48 h'0460 dtcec5 tpu channel 3 * 4 tgi3b 49 h'0462 dtcec4 tgi3c 50 h'0464 dtcec3 tgi3d 51 h'0466 dtcec2 tgi4a 56 h'0470 dtcec1 tpu channel 4 * 4 tgi4b 57 h'0472 dtcec0 tgi5a 60 h'0478 dtced5 tpu channel 5 * 4 tgi5b 61 h'047a dtced4 cmia0 64 h'0480 dtced3 8-bit timer channel 0 cmib0 65 h'0482 dtced2 low
section 9 data transfer controller (dtc) rev. 5.00 aug 08, 2006 page 293 of 982 rej09b0054-0500 interrupt source origin of interrupt source vector number dtc vector address dtce * 1 priority cmia1 68 h'0488 dtced1 high 8-bit timer channel 1 cmib1 69 h'048a dtced0 dend0a 72 h'0490 dtcee7 dend0a 73 h'0492 dtcee6 dend1a 74 h'0494 dtcee5 dmac * 2 dend1a 75 h'0496 dtcee4 rxi0 81 h'04a2 dtcee3 sci channel 0 txi0 82 h'04a4 dtcee2 rxi1 85 h'04aa dtcee1 sci channel 1 txi1 86 h'04ac dtcee0 rxi2 89 h'04b2 dtcef7 sci channel 2 * 4 txi2 90 h'04b4 dtcef6 cmia2 92 h'04b8 dtcef5 8-bit timer channel 2 * 3 cmib2 93 h'04ba dtcef4 cmia3 96 h'04c0 dtcef3 8-bit timer channel 3 * 3 cmib3 97 h'04c2 dtcef2 iic channel 0 (optional) * 3 iici0 100 h'04c8 dtcef1 iic channel 1 (optional) * 3 iici1 102 h'04cc dtcef0 ieb * 5 ierxi (rxrdy) 105 h'04d2 dtceg6 ietxi (txrdy) 106 h'04d4 dtceg5 rxi3 121 h'04f2 dtcei7 sci channel 3 txi3 122 h'04f4 dtcei6 low notes: 1. dtce bits with no corresponding interrupt are reserved, and should be written with 0. 2. supported only by the h8s/2239 group. 3. these channels are not available in the h8s/2237 group or h8s/2227 group. 4. these channels are not available in the h8s/2227 group. 5. supported only by the h8s/2258 group.
section 9 data transfer controller (dtc) rev. 5.00 aug 08, 2006 page 294 of 982 rej09b0054-0500 9.5 operation register information is stored in on-chip ram. when activated, the dtc reads register information in on-chip ram and transfers data. after the data transfer, the dtc writes updated register information back to the memory. the pre-storage of register information in memory makes it possible to transfer data over any required number of channels. the transfer mode can be specified as normal, repeat, and block transfer mode. setting the chne bit in mrb to 1 makes it possible to perform a number of transfers with a single activation source (chain transfer). the 24-bit sar designates the dtc transfer source address, and the 24-bit dar designates the transfer destination address. after each transfer, sar and dar are independently incremented, decremented, or left fixed depending on its register information. figure 9.5 shows the flowchart of dtc operation. start end read dtc vector read register infomation data transfer write register information interrupt exception handling clear dtcer clear an activation flag chne = 1 next transfer yes no yes no transfer counter = 0 or disel = 1 note: * for details of the operation, see the section for each peripheral module. * figure 9.5 flowchart of dtc operation
section 9 data transfer controller (dtc) rev. 5.00 aug 08, 2006 page 295 of 982 rej09b0054-0500 9.5.1 normal mode in normal mode, one operation transfers one byte or one word of data. from 1 to 65,536 transfers can be specified. once the specified number of transfers have been completed, a cpu interrupt can be requested. table 9.3 lists the register information in normal mode. figure 9.6 shows the memory mapping in normal mode. table 9.3 register information in normal mode name abbreviation function dtc source address register sar designates source address dtc destination address register dar designates destination address dtc transfer count register a cra designates transfer count dtc transfer count register b crb not used sar dar transfer figure 9.6 memory mapping in normal mode 9.5.2 repeat mode in repeat mode, one operation transfers one byte or one word of data. from 1 to 256 transfers can be specified. once the specified number of transfers have ended, the initial state of the transfer counter and the address register specified as the repeat area is restored, and transfer is repeated. in repeat mode the transfer counter value does not reach h'00, and therefore cpu interrupts cannot be requested when disel = 0.
section 9 data transfer controller (dtc) rev. 5.00 aug 08, 2006 page 296 of 982 rej09b0054-0500 table 9.4 lists the register information in repeat mode. figure 9.7 shows the memory mapping in repeat mode. table 9.4 register information in repeat mode name abbreviation function dtc source address register sar designates source address dtc destination address register dar designates destination address dtc transfer count register ah crah holds number of transfers dtc transfer count register al cral designates transfer count dtc transfer count register b crb not used sar or dar dar or sar repeat area transfer figure 9.7 memory mapping in repeat mode 9.5.3 block transfer mode in block transfer mode, one operation transfers one block of data. either the transfer source or the transfer destination is designated as a block area. the block size can be between 1 to 256. when the transfer of one block ends, the initial state of the block size counter and the address register specified as the block area is restored. the other address register is then incremented, decremented, or left fixed. from 1 to 65,536 transfers can be specified. once the specified number of transfers have been completed, a cpu interrupt is requested.
section 9 data transfer controller (dtc) rev. 5.00 aug 08, 2006 page 297 of 982 rej09b0054-0500 table 9.5 lists the register information in block transfer mode. figure 9.8 shows the memory mapping in block transfer mode. table 9.5 register information in block transfer mode name abbreviation function dtc source address register sar designates source address dtc destination address register dar designates destination address dtc transfer count register ah crah holds block size dtc transfer count register al cral designates block size count dtc transfer count register b crb transfer count first block transfer block area nth block dar or sar sar or dar figure 9.8 memory mapping in block transfer mode
section 9 data transfer controller (dtc) rev. 5.00 aug 08, 2006 page 298 of 982 rej09b0054-0500 9.5.4 chain transfer setting the chne bit in mrb to 1 enables a number of data transfers to be performed consecutively in response to a single transfer request. sar, dar, cra, crb, mra, and mrb, which define data transfers, can be set independently. figure 9.9 shows the memory map for chain transfer. when activated, the dtc reads the register information start address stored at the vector address, and then reads the first register information at that start address. after the data transfer, the chne bit will be tested. when it has been set to 1, dtc reads the next register information located in a consecutive area and performs the data transfer. these sequences are repeated until the chne bit is cleared to 0. in the case of transfer with chne set to 1, an interrupt request to the cpu is not generated at the end of the specified number of transfers or by setting of the disel bit to 1, and the interrupt source flag for the activation source is not affected. dtc vector address register information chne = 1 register information chne = 0 register information start address source destination source destination figure 9.9 chain transfer operation
section 9 data transfer controller (dtc) rev. 5.00 aug 08, 2006 page 299 of 982 rej09b0054-0500 9.5.5 interrupts an interrupt request is issued to the cpu when the dtc has completed the specified number of data transfers, or a data transfer for which the disel bit was set to 1. in the case of interrupt activation, the interrupt set as the activation source is generated. these interrupts to the cpu are subject to cpu mask level and interrupt controller priority level control. in the case of software activation, a software-activated data transfer end interrupt (swdtend) is generated. when the disel bit is 1 and one data transfer has been completed, or the specified number of transfers have been completed, after data transfer ends the swdte bit is held at 1 and an swdtend interrupt is generated. the interrupt handling routine will then clear the swdte bit to 0. when the dtc is activated by software, an swdtend interrupt is not generated during a data transfer wait or during data transfer even if the swdte bit is set to 1. 9.5.6 operation timing figures 9.10 to 9.12 show the dtc operation timings. dtc activation request dtc request address vector read read write data transfer transfer information write transfer information read figure 9.10 dtc operation timing (example in normal mode or repeat mode)
section 9 data transfer controller (dtc) rev. 5.00 aug 08, 2006 page 300 of 982 rej09b0054-0500 dtc activation request dtc request address vector read read write read write data transfer transfer information write transfer information read figure 9.11 dtc operation timing (example of block transfer mode, with block size of 2) dtc activation request dtc request address vector read read write read write data transfer data transfer transfer information write transfer information write transfer information read transfer information read figure 9.12 dtc operation timing (example of chain transfer)
section 9 data transfer controller (dtc) rev. 5.00 aug 08, 2006 page 301 of 982 rej09b0054-0500 9.5.7 number of dtc execution states table 9.6 lists execution status for a single dtc data transfer, and table 9.7 shows the number of states required for each execution status. table 9.6 dtc execution status mode vector read i register information read/write j data read k data write l internal operations m normal 1 6 1 1 3 repeat 1 6 1 1 3 block transfer 1 6 n n 3 legend: n: block size (initial setting of crah and cral) table 9.7 number of states required for each execution status object to be accessed on- chip ram on- chip rom internal i/o registers external devices bus width 32 16 8 16 8 8 16 16 access states 1 1 2 2 2 3 2 3 vector read s i ? 1 ?? 4 6 + 2 m 2 3 + m execution status register information read/write s j 1 ????? ?? byte data read s k 1 1 2 2 2 3 + m 2 3 + m word data read s k 1 1 4 2 4 6 + 2 m 2 3 + m byte data write s l 1 1 2 2 2 3 + m 2 3 + m word data write s l 1 1 4 2 4 6 + 2 m 2 3 + m internal operation s m 1 legend: m: the number of wait states for accessing external devices. the number of execution states is calculated from using the formula below. note that is the sum of all transfers activated by one activation event (the number in which the chne bit is set to 1, plus 1). number of execution states = i s i + (j s j + k s k + l s l ) + m s m
section 9 data transfer controller (dtc) rev. 5.00 aug 08, 2006 page 302 of 982 rej09b0054-0500 for example, when the dtc vector address table is located in the on-chip rom, normal mode is set, and data is transferred from on-chip rom to an internal i/o register, then the time required for the dtc operation is 13 states. the time from activation to the end of the data write is 10 states. 9.6 procedures for using dtc 9.6.1 activation by interrupt the procedure for using the dtc with interrupt activation is as follows: 1. set the mra, mrb, sar, dar, cra, and crb register information in on-chip ram. 2. set the start address of the register information in the dtc vector address. 3. set the corresponding bit in dtcer to 1. 4. set the enable bits for the interrupt sources to be used as the activation sources to 1. the dtc is activated when an interrupt used as an activation source is generated. 5. after one data transfer has been completed, or after the specified number of data transfers have been completed, the dtce bit is cleared to 0 and a cpu interrupt is requested. if the dtc is to continue transferring data, set the dtce bit to 1. 9.6.2 activation by software the procedure for using the dtc with software activation is as follows: 1. set the mra, mrb, sar, dar, cra, and crb register information in on-chip ram. 2. set the start address of the register information in the dtc vector address. 3. check that the swdte bit is 0. 4. write 1 to swdte bit and the vector number to dtvecr. 5. check the vector number written to dtvecr. 6. after one data transfer has been completed, if the disel bit is 0 and a cpu interrupt is not requested, the swdte bit is cleared to 0. if the dtc is to continue transferring data, set the swdte bit to 1. when the disel bit is 1, or after the specified number of data transfers have been completed, the swdte bit is held at 1 and a cpu interrupt is requested.
section 9 data transfer controller (dtc) rev. 5.00 aug 08, 2006 page 303 of 982 rej09b0054-0500 9.7 examples of use of the dtc 9.7.1 normal mode an example is shown in which the dtc is used to receive 128 bytes of data via the sci. 1. set mra to a fixed source address (sm1 = sm0 = 0), incrementing destination address (dm1 = 1, dm0 = 0), normal mode (md1 = md0 = 0), and byte size (sz = 0). the dts bit can have any value. set mrb for one data transfer by one interrupt (chne = 0, disel = 0). set the sci rdr address in sar, the start address of the ram area where the data will be received in dar, and 128 (h'0080) in cra. crb can be set to any value. 2. set the start address of the register information at the dtc vector address. 3. set the corresponding bit in dtcer to 1. 4. set the sci to the appropriate receive mode. set the rie bit in scr to 1 to enable the reception complete (rxi) interrupt. since the generation of a receive error during the sci reception operation will disable subsequent reception, the cpu should be enabled to accept receive error interrupts. 5. each time the reception of one byte of data has been completed on the sci, the rdrf flag in ssr is set to 1, an rxi interrupt is generated, and the dtc is activated. the receive data is transferred from rdr to ram by the dtc. dar is incremented and cra is decremented. the rdrf flag is automatically cleared to 0. 6. when cra becomes 0 after the 128 data transfers have been completed, the rdrf flag is held at 1, the dtce bit is cleared to 0, and an rxi interrupt request is sent to the cpu. the interrupt handling routine will perform wrap-up processing. 9.7.2 software activation an example is shown in which the dtc is used to transfer a block of 128 bytes of data by means of software activation. the transfer source address is h'1000 and the destination address is h'2000. the vector number is h'60, so the vector address is h'04c0. 1. set mra to incrementing source address (sm1 = 1, sm0 = 0), incrementing destination address (dm1 = 1, dm0 = 0), block transfer mode (md1 = 1, md0 = 0), and byte size (sz = 0). the dts bit can have any value. set mrb for one block transfer by one interrupt (chne = 0). set the transfer source address (h'1000) in sar, the destination address (h'2000) in dar, and 128 (h'8080) in cra. set 1 (h'0001) in crb. 2. set the start address of the register information at the dtc vector address (h'04c0). 3. check that the swdte bit in dtvecr is 0. check that there is currently no transfer activated by software.
section 9 data transfer controller (dtc) rev. 5.00 aug 08, 2006 page 304 of 982 rej09b0054-0500 4. write 1 to the swdte bit and the vector number (h'60) to dtvecr. the write data is h'e0. 5. read dtvecr again and check that it is set to the vector number (h'60). if it is not, this indicates that the write failed. this is presumably because an interrupt occurred between steps 3 and 4 and led to a different software activation. to activate this transfer, go back to step 3. 6. if the write was successful, the dtc is activated and a block of 128 bytes of data is transferred. 7. after the transfer, an swdtend interrupt occurs. the interrupt handling routine should clear the swdte bit to 0 and perform other wrap-up processing. 9.8 usage notes 9.8.1 module stop mode setting dtc operation can be disabled or enabled using the module stop control register. the initial setting is for dtc operation to be enabled. register access is disabled by setting module stop mode. module stop mode cannot be set during dtc operation. for details, refer to section 24, power-down modes. 9.8.2 on-chip ram the mra, mrb, sar, dar, cra, and crb registers are all located in on-chip ram. when the dtc is used, the rame bit in syscr should not be cleared to 0. 9.8.3 dtce bit setting for dtce bit setting, use bit manipulation instructions such as bset and bclr. if all interrupts are masked, multiple activation sources can be set at one time (only at the initial setting) by writing data after executing a dummy read on the relevant register.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 305 of 982 rej09b0054-0500 section 10 i/o ports table 10.1 summarizes the port functions. the pins of each port also have other functions such as input/output or interrupt input pins of on-chip peripheral modules. each i/o port includes a data direction register (ddr) that controls input/output, a data register (dr) that stores output data, and a port register (port) used to read the pin states. the input-only ports do not have dr and ddr registers. ports a to e have a built-in input pull-up mos function and an input pull-up mos control register (pcr) to control the on/off state of input pull-up mos respectively. ports 3 and a include an open-drain control register (odr) that controls the on/off state of the output buffer pmos respectively. all the i/o ports can drive a single ttl load and a 30-pf capacitive load. the p35 and p34 pins on port 3 are nmos push pull outputs.* the irq pin is schmitt-trigger input. note: * supported only by the h8s/2258 group, h8s/2239 group, and h8s/2238 group.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 306 of 982 rej09b0054-0500 table 10.1 port functions port description mode4 mode5 mode 6 mode 7 input/output and output type p17/tiocb2/tclkd p17/tiocb2/tclkd p16/tioca2/ irq1 p16/tioca2/ irq1 p15/tiocb1/tclkc p15/tiocb1/tclkc p14/tioca1/ irq0 p14/tioca1/ irq0 p13/tiocd0/tclkb/a23 p13/tiocd0/tclkb p12/tiocc0/tclka/a22 p12/tiocc0/tclka p11/tiocb0/ dack1 * 3 /a21 p11/tiocb0/ dack1 * 3 port 1 general i/o port also functioning as tpu_2, tpu_1, and tpu_0 i/o pins, interrupt input pins, address output pins, and dmac output pins p10/tioca0/ dack0 * 3 /a20 p10/tioca0/ dack0 * 3 schmitt-trigger input ( irq0 , irq1 ) p36 p35/sck1/scl0 * 1 / irq5 p34/rxd1/sda0 * 1 p33/txd1/sda0 * 1 p32/sck0/sda1 * 1 / irq4 p31/rxd0 port 3 general i/o port also functioning as i 2 c bus interface * 1 i/o pins, sci_1 and sci_0 i/o pins, and interrupt input pins p30/txd0 specifiable of open drain output schmitt-trigger input ( irq4 , irq5 ) nmos push-pull output * 1 (p35, p34, sck1) p47/an7 p46/an6 p45/an5 p44/an4 p43/an3 p42/an2 p41/an1 port 4 general input port also functioning as a/d converter analog input pins p40/an0 p77/txd3 p76/rxd3 p75/tmo3 * 1 /sck3 p74/tmo2 * 1 / mres p73/tmo1/ tend1 * 3 / cs7 p73/tmo1/ tend1 * 3 p72/tmo0/ tend0 * 3 / cs6 p72/tmo0/ tend0 * 3 p71/tmri23 * 1 /tmci23 * 1 / dreq1 * 3 / cs5 p71/tmri23 * 1 /tmci23 * 1 / dreq1 * 3 port 7 general i/o port also functioning as sci_3 i/o pins, tmr_3 * 1 , tmr_2 * 1 , tmr_1, tmr_0 i/o pins, and dmac i/o pins p70/tmri01/tmci01/ dreq0 * 3 / cs4 p70/tmri01/tmci01/ dre q0 * 3
section 10 i/o ports rev. 5.00 aug 08, 2006 page 307 of 982 rej09b0054-0500 port description mode 4 mode5 mode 6 mode 7 input/output and output type p97/da1 * 2 port 9 general i/o port also functioning as d/a converter * 2 analog output pins p96/ da0 * 2 pa3/a19/sck2 * 2 pa3/sck2 * 2 pa2/a18/rxd2 * 2 pa2/rxd2 * 2 pa1/a17/txd2 * 2 pa1/txd2 * 2 port a general i/o port also functioning as sci_2 * 2 i/o pins and address output pins pa0/a16 pa0 specifiable of built-in input pull-up mos open drain output pb7/a15/tiocb5 * 2 pb7/tiocb5 * 2 pb6/a14/tioca5 * 2 pb6/tioca5 * 2 pb5/a13/tiocb4 * 2 pb5/tiocb4 * 2 pb4/a12/tioca4 * 2 pb4/tioca4 * 2 pb3/a11/tiocd3 * 2 pb3/tiocd3 * 2 pb2/a10/tiocc3 * 2 pb2/tiocc3 * 2 pb1/a9/tiocb3 * 2 pb1/tiocb3 * 2 port b general i/o port also functioning as tpu_5 * 2 , tpu_4 * 2 , tpu_3 * 2 i/o pins, and address output pins pb0/a8/tioca3 * 2 pb0/tioca3 * 2 built-in input pull-up mos a7 pc7/a7 pc7 a6 pc6/a6 pc6 a5 pc5/a5 pc5 a4 pc4/a4 pc4 a3 pc3/a3 pc3 a2 pc2/a2 pc2 a1 pc1/a1 pc1 port c general i/o port also functioning as address output pins a0 pc0/a0 pc0 built-in input pull-up mos d15 pd7 d14 pd6 d13 pd5 d12 pd4 d11 pd3 d10 pd2 d9 pd1 port d general i/o port also functioning as data i/o pins d8 pd0 built-in input pull-up mos
section 10 i/o ports rev. 5.00 aug 08, 2006 page 308 of 982 rej09b0054-0500 port description mode 4 mode5 mode 6 mode 7 input/output and output type pe7/d7 pe7 pe6/d6 pe6 pe5/d5 pe5 pe4/d4 pe4 pe3/d3 pe3 pe2/d2 pe2 pe1/d1 pe1 port e general i/o port also functioning as data i/o pins pe0/d0 pe0 built-in input pull-up mos pf7/ pf7/ as pf6 rd pf5 hwr pf4 pf3/ lwr / adtrg / irq3 pf3/ adtrg / irq3 pf2/ wait pf2 pf1/ back /buzz pf1/buzz port f general i/o port also functioning as interrupt input pins, bus control i/o pins, an a/d converter input pins and wdt output pins pf0/ breq / irq2 pf0/ irq2 schmit-trigger input ( irq2 , irq3 ) pg4/ cs0 pg4 pg3/ rx / cs1 * 4 pg3/ rx pg2/ tx / cs2 * 4 pg2/ tx pg1/ cs3 / irq7 pg1/ irq7 port g general i/o port also functioning as interrupt input pins pg0/ irq6 pg0/ irq6 schmit-trigger input ( irq6 , irq7 ) notes: 1. not available in the h8s/2237 group and h8s/2227 group. 2. not available in the h8s/2227 group. 3. supported only by the h8s/2239 group. 4. supported only by the h8s/2258 group.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 309 of 982 rej09b0054-0500 10.1 port 1 port 1 is an 8-bit i/o port and has the following registers. ? port 1 data direction register (p1ddr) ? port 1 data register (p1dr) ? port 1 register (port1) 10.1.1 port 1 data direction register (p1ddr) p1ddr specifies input or output of the port 1 pins using the individual bits. p1ddr cannot be read; if it is, an undefined value will be read. this register is a write-only register, and cannot be written by bit manipulation instruction. for details, see section 2.9.4, access methods for registers with write-only bits. bit bit name initial value r/w description 7 p17ddr 0 w 6 p16ddr 0 w 5 p15ddr 0 w 4 p14ddr 0 w 3 p13ddr 0 w 2 p12ddr 0 w 1 p11ddr 0 w 0 p10ddr 0 w when a pin is specified as a general purpose i/o port, setting this bit to 1 makes the corresponding port 1 pin an output pin. clearing this bit to 0 makes the pin an input pin.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 310 of 982 rej09b0054-0500 10.1.2 port 1 data register (p1dr) p1dr stores output data for port 1 pins. bit bit name initial value r/w description 7 p17dr 0 r/w 6 p16dr 0 r/w 5 p15dr 0 r/w 4 p14dr 0 r/w 3 p13dr 0 r/w 2 p12dr 0 r/w 1 p11dr 0 r/w 0 p10dr 0 r/w output data for a pin is stored when the pin is specified as a general purpose i/o port. 10.1.3 port 1 register (port1) port1 shows the pin states. this register cannot be modified. bit bit name initial value r/w description 7p17 ? * r 6p16 ? * r 5p15 ? * r 4p14 ? * r 3p13 ? * r 2p12 ? * r 1p11 ? * r 0p10 ? * r if a port 1 read is performed while p1ddr bits are set to 1, the p1dr values are read. if a port 1 read is performed while p1ddr bits are cleared to 0, the pin states are read. note: * determined by the states of pins p17 to p10.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 311 of 982 rej09b0054-0500 10.1.4 pin functions port 1 pins also function as tpu i/o pins (tpu_0, tpu_1, and tpu_2), dmac* output pins, interrupt input pins and address output pins. values of the register and pin functions are shown below. note: * supported only by the h8s/2239 group. ? p17/tiocb2/tclkd the pin functions are switched as shown below according to the combination of the tpu channel 2 setting, tpsc2 to tps0 bits in tcr_0 and tcr_5, and the p17ddr bit. tpu channel 2 setting * 1 output input or initial value p17ddr ? 01 p17 input pin p17 output pin tiocb2 output pin tiocb2 input pin * 2 pin functions tclkd input pin * 3 notes: 1. for the setting of the tpu channel, see section 11, 16-bit timer pulse unit (tpu). 2. this pin functions as tiocb2 input when tpu channel 2 timer operating mode is set to normal operating or phase counting mode and iob3 in tior_2 is set to 1. 3. this pin functions as tclkd input when tpsc2 to tpsc0 in tcr_0 or tcr_5 are set to 111 or when channels 2 and 4 are set to phase counting mode. ? p16/tioca2/ irq1 the pin functions are switched as shown below according to the combination of the tpu channel 2 setting and the p16ddr bit. tpu channel 2 setting * 1 output input or initial value p16ddr ? 01 p16 input pin p16 output pin tioca2 output pin tioca2 input pin * 2 pin functions irq1 input pin * 3 notes: 1. for the setting of the tpu channel, see section 11, 16-bit timer pulse unit (tpu). 2. this pin functions as tioca2 input when tpu channel 2 timer operating mode is set to normal operating or phase counting mode and ioa3 in tior_2 is 1. 3. when this pin is used as an external interrupt pin, do not specify other functions.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 312 of 982 rej09b0054-0500 ? p15/tiocb1/tclkc the pin functions are switched as shown below according to the combination of the tpu channel 1 setting, tpsc2 to tps0 bits in tcr_0, tcr_2, tcr_4, and tcr_5 and the p15ddr bit. tpu channel 1 setting * 1 output input or initial value p15ddr ? 01 p15 input pin p15 output pin tiocb1 output pin tiocb1 input pin * 2 pin functions tclkc input pin * 3 notes: 1. for the setting of the tpu channel, see section 11, 16-bit timer pulse unit (tpu). 2. this pin functions as tiocb1 input when tpu channel 1 timer operating mode is set to normal operating or phase counting mode and iob3 to iob0 in tior_1 are set to10xx. 3. this pin functions as tclkc input when tpsc2 to tpsc0 in tcr_0 or tcr_2 are set to 110 or tpsc2 to tpsc0 in tcr_4 or tcr_0 are 101 or when channels 2 and 4 are set to phase counting mode. ? p14/tioca1/ irq0 the pin functions are switched as shown below according to the combination of the tpu channel 1 setting and the p14ddr bit. tpu channel 1 setting * 1 output input or initial value p14ddr ? 01 p14 input pin p14 output pin tioca1 output pin tioca1 input pin * 2 pin functions irq0 input pin * 3 notes: 1. for the setting of the tpu channel, see section 11, 16-bit timer pulse unit (tpu). 2. this pin functions as tioca1 input when tpu channel 1 timer operating mode is set to normal operating or phase counting mode and ioa3 to ioa0 in tior_1 are set to 10xx. 3. when this pin is used as an external interrupt pin, do not specify other functions.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 313 of 982 rej09b0054-0500 ? p13/tiocd0/tclkb/a23 the pin functions are switched as shown below according to the combination of operating mode, the tpu channel 0 setting, tpsc2 to tpsc0 bits in tcr_0 to tcr_2, ae3 to ae0 bits in pfcr and the p13ddr bit. operating mode modes 4 to 6 mode 7 ae3 to ae0 b'1111 other than b'1111 ? tpu channel 0 setting * 1 ? output input or initial value output input or initial value p13ddr ?? 01 ? 01 p13 input pin p13 output pin p13 input pin p13 output pin tiocd0 output pin tiocd0 input * 2 tiocd0 output pin tiocd0 input pin * 2 pin functions a23 output pin tclkb input pin * 3 tclkb input pin * 3 notes: 1. for the setting of the tpu channel, see section 11, 16-bit timer pulse unit (tpu). 2. this pin functions as tiocd0 input when tpu channel 0 timer operating mode is set to normal operating and iod3 to iod0 in tiorl_0 are set to 10xx. 3. this pin functions as tclkb input when tpsc2 to tpsc0 in any of tcr_0 to tcr_2 are set to 101 or when channels 1 and 5 are set to phase counting mode. ? p12/tiocc0/tclka/a22 the pin functions are switched as shown below according to the combination of operating mode, the tpu channel 0 setting, tpsc2 to tpsc0 bits in tcr_0 to tcr_5, ae3 to ae0 bits in pfcr, and the p12ddr bit. operating mode modes 4 to 6 mode 7 ae3 to ae0 b'1111 other than b'1111 ? tpu channel 0 setting * 1 ? output input or initial value output input or initial value p12ddr ?? 01 ? 01 p12 input pin p12 output pin p12 input pin p12 output pin tiocc0 output pin tiocc0 input pin * 2 tiocc0 output pin tiocc0 input pin * 2 pin functions a22 output pin tclka input pin * 3 tclka input pin * 3 notes: 1. for the setting of the tpu channel, see section 11, 16-bit timer pulse unit (tpu). 2. this pin functions as tiocc0 input when tpu channel 0 timer operating mode is set to normal operating and ioc3 to ioc0 in tiorl_0 are set to 10xx. 3. this pin functions as tclkb input when tpsc2 to tpsc0 in any of tcr_0 to tcr_5 are set to 100 or when channels 1 and 5 are set to phase counting mode.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 314 of 982 rej09b0054-0500 ? p11/tiocb0/ dack1 /a21 the pin functions are switched as shown below according to the combination of operating mode, the tpu channel 0 setting, ae3 to ae0 bits in pfcr, the sae1 bit* 3 in dmabcrh, and the p11ddr bit. operating mode modes 4 to 6 mode 7 ae3 to ae0 b'111x other than b'111x ? sae1 * 3 ? 01 ? tpu channel 0 setting * 1 ? output input or initial value ? output input or initial value p11ddr ?? 01 ?? 01 p11 input pin p11 output pin dack1 * 3 output pin p11 input pin p11 output pin pin functions a21 output pin tiocb0 output pin tiocb0 input pin * 2 tiocb0 output pin tiocb0 input pin * 2 notes: 1. for the setting of the tpu channel, see section 11, 16-bit timer pulse unit (tpu). 2. this pin functions as tiocb0 input when tpu channel 0 timer operating mode is set to normal operating and iob3 to iob0 in tiorh_0 are set to 10xx. 3. supported only by the h8s/2239 group. ? p10/tioca0/ dack0 /a20 the pin functions are switched as shown below according to the combination of operating mode, the tpu channel 0 setting, ae3 to ae0 bits in pfcr, the sae0 bit* 3 in dmabcrh, and the p10ddr bit. operating mode modes 4 to 6 mode 7 ae3 to ae0 b'1101 or b'111x other than (b'1101 or b'111x) ? sae0 * 3 ? 01 ? tpu channel 0 setting * 1 ? output input or initial value ? output input or initial value p10ddr ?? 01 ?? 01 p10 input pin p10 output pin dack0 * 3 output pin p10 input pin p10 output pin pin functions a20 output pin tioca0 output pin tioca0 input pin * 2 tioca0 output pin tioca0 input pin * 2 notes: 1. for the setting of the tpu channel, see section 11, 16-bit timer pulse unit (tpu). 2. this pin functions as tioca0 input when tpu channel 0 timer operating mode is set to normal operating and ioa3 to ioa0 in tiorh_0 are set to 10xx. 3. supported only by the h8s/2239 group.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 315 of 982 rej09b0054-0500 10.2 port 3 port 3 is a general 7-bit i/o port and has the following registers. the p34, p35, and sck1 function as nmos push/pull outputs.* ? port 3 data direction register (p3ddr) ? port 3 data register (p3dr) ? port 3 register (port3) ? port 3 open drain control register (p3odr) note: * function as cmos outputs in the h8s/2237 group and h8s/2227 group. 10.2.1 port 3 data direction register (p3ddr) p3ddr specifies input or output of the port 3 pins using the individual bits. p3ddr cannot be read; if it is, an undefined value will be read. this register is a write-only register, and cannot be written by bit manipulation instruction. for details, see section 2.9.4, access methods for registers with write-only bits. bit bit name initial value r/w description 7 ? undefined ? reserved these bits are always read as undefined value. 6 p36ddr 0 w 5 p35ddr 0 w 4 p34ddr 0 w 3 p33ddr 0 w 2 p32ddr 0 w 1 p31ddr 0 w 0 p30ddr 0 w when a pin is specified as a general purpose i/o port, setting this bit to 1 makes the corresponding port 3 pin an output port. clearing this bit to 0 makes the pin an input port.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 316 of 982 rej09b0054-0500 10.2.2 port 3 data register (p3dr) p3dr stores output data for port 3 pins. bit bit name initial value r/w description 7 ? undefined ? reserved these bits are always read as undefined value. 6 p36dr 0 r/w 5 p35dr 0 r/w 4 p34dr 0 r/w 3 p33dr 0 r/w 2 p32dr 0 r/w 1 p31dr 0 r/w 0 p30dr 0 r/w output data for a pin is stored when the pin is specified as a general purpose i/o port. 10.2.3 port 3 register (port3) bit bit name initial value r/w description 7 ? undefined ? reserved these bits are always read as undefined value. 6p36 ? * r 5p35 ? * r 4p34 ? * r 3p33 ? * r 2p32 ? * r 1p31 ? * r 0p30 ? * r if a port 3 read is performed while p3ddr bits are set to 1, the p3dr values are read. if a port 3 read is performed while p3ddr bits are cleared to 0, the pin states are read. note: * determined by the states of pins p36 to p30.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 317 of 982 rej09b0054-0500 10.2.4 port 3 open drain control register (p3odr) p3odr controls on/off state of the pmos for port 3 pins. bit bit name initial value r/w description 7 ? undefined ? reserved these bits are always read as undefined value. 6 p36odr 0 r/w 5 p35odr 0 r/w 4 p34odr 0 r/w 3 p33odr 0 r/w 2 p32odr 0 r/w 1 p31odr 0 r/w 0 p30odr 0 r/w when each of p36odr and p33odr to p30odr bits is set to 1, the corresponding pins p36 and p33 to p30 function as nmos open drain outputs. when cleared to 0, the corresponding pins function as cmos outputs. when each of p35odr and p34odr bits is set to 1, the corresponding pins p35 and p34 function as open drain outputs. when they are cleared to 0, the corresponding pins function as nmos push pull outputs. * note: * when they are cleared to 0, the corresponding pins function as cmos outputs in the h8s/2237 group and h8s/2227 group. 10.2.5 pin functions the port 3 pins also function as sci i/o input pins, i2c bus interface* i/o pins, and as external interrupt input pins. as shown in figure 10.1, when the pins p35, p34, sck1, scl0, or sda0 type open drain output is used, a bus line is not affected even if the power supply for this lsi fails. use (a) type open drain output when using a bus line having a state in which the power is not supplied to this lsi. note: * the i 2 c bus interface is not available in the h8s/2237 group and h8s/2227 group.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 318 of 982 rej09b0054-0500 output 0 (a) open drain output type for p34, p35, sck1, scl0, and sda0 pins nmos off output (b) open drain output type for p33 to p30, scl1, and sda1 pins pmos off input 1 input figure 10.1 types of open drain outputs the p34, p35, and sck1 nmos push-pull outputs will not output the vcc level, regardless of the load, even if set to the high output state. external pull-up resistors are required to output the vcc level. notes: 1. note that the signal rise and fall times become longer when external pull-up resistors are connected. if signals with long rise and fall times are input, use input circuits with noise absorbing functions, such as schmitt trigger circuits. 2. implement external circuit countermeasures such as inserting level shifters if the device is operated at high speeds. 3. see the output high-level voltage items in tables 27.2, 27.14, 27.27, and 27.39 on pages 34 to 35 for the output characteristics. use values for the pull-up resistors such that the allowable output current conditions in tables 27.3, 27.15, 27.28, and 27.40 are met. * this is not present in the h8s/2227 group and the h8s/2237 group products. the h8s/2227 group and the h8s/2237 group products do not have an iic bus, and the p34 and p35 pin outputs are cmos outputs (when the p34odr and p35odr bits for the pins are 0). when using an emulator that includes either an h8s/2633 evaluation chip or an h8s/2238 evaluation chip, these pins will be nmos push-pull outputs. therefore the pin output characteristics will differ from those in the h8s/2227 group and the h8s/2237 group products. if cmos output characteristics are required in pins p34 and p35, pull up the emulator p34 and p35 pins with an appropriate resistor. ? p36 the pin functions are switched as shown below according to the p36ddr bit condition. p36ddr 0 1 pin functions p36 input pin p36 output pin * note: * when p36odr is set to 1, functions as nmos open drain output.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 319 of 982 rej09b0054-0500 ? p35/sck1/scl0/ irq5 the pin functions are switched as shown below according to the combination of the ice bit * 3 in iccr_0 of iic_0, the c/ a bit in smr_1 of sci_1, cke0 and cke1 bits in scr_1, and the p35ddr bit. to use this port as scl0 i/o pin, clear the c/ a bit, cke1 bit, and cke0 bit to 0. the scl0 functions as nmos open drain output and the pin can drive bus directly. when this pin is specified as the p35 output pin or sck1 output pin, it functions as nmos push/pull output. * 4 ice * 3 01 cke1 0 1 0 c/ a 01 ? 0 cke0 0 1 ?? 0 p35ddr 0 1 ???? p35 input pin p35 output pin * 1 sck1 output pin * 1 sck1 output pin * 1 sck1 input pin scl0 i/o pin * 3 pin functions irq5 input pin * 2 notes: 1. when the p35odr is set to 1, it functions as nmos open drain output. when the p35odr is cleared to 0, it functions as nmos push/pull output. * 4 2. when this pin is used as an external interrupt pin, do not specify other functions. 3. not available in the h8s/2237 group and h8s/2227 group. 4. it functions as cmos output in the h8s/2237 group and h8s/2227 group. ? p34/rxd1/sda0 the pin functions are switched as shown below according to the combination of the ice bit * 2 in iccr_0 of iic_0, the re bit in scr_1 of sci_1, and the p34ddr bit. when this pin is specified as p34 output pin, it functions as nmos push-pull output. * 3 the sda0 also functions as nmos open drain outputs and can drive bus directly. ice * 2 01 re 01 ? p34ddr 01 ?? pin functions p34 input pin p34 output pin * 1 rxd1 input pin sda0 i/o pin * 2 notes: 1. when p34odr is set to 1, it functions as nmos open drain output. when the p34odr is cleared to 0, it functions as nmos push/pull output. * 3 2. not available in theh8s/2237 group and h8s/2227 group. 3. it functions as cmos output in the h8s/2237 group and h8s/2227 group.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 320 of 982 rej09b0054-0500 ? p33/txd1/scl1 the pin functions are switched as shown below according to the combination of the ice bit * 2 in iccr_1 of iic_1, the te bit in scr_1 of sci_1, and the p33ddr bit. scl1 functions as nmos open drain output and can drive bus directly. ice * 2 01 te 01 ? p33ddr 01 ?? pin functions p33 input pin p33 output pin * 1 txd1 output pin * 1 scl1 i/o pin * 2 notes: 1. when p33odr is set to 1, it functions as nmos open drain output. 2. not available in the h8s/2237 group and h8s/2227 group. ? p32/sck0/sda1/ irq4 the pin functions are switched as shown below according to the combination of the ice bit * 3 in iccr_1 of iic_1, the c/ a bit in smr_0 of sci_0, cke1 and cke0 bits in scr, and the p32ddr bit. to use this port as sda1 input pin, clear the c/ a bit, cke0 bit, and cke1 bit to 0. the sda1 functions as nmos open drain output and can drive bus directly. ice * 3 01 cke1 0 1 0 c/ a 01 ? 0 cke0 0 1 ?? 0 p32ddr 0 1 ???? p32 input pin p32 output pin * 1 sck0 output pin * 1 sck0 output pin * 1 sck0 input pin sda1 i/o pin * 3 pin functions irq4 input * 2 notes: 1. when p32odr is set to 1, it functions as nmos open drain output. 2. when this pin is used as an external interrupt pin, do not specify other functions. 3. not available in the h8s/2237 group and h8s/2227 group. ? p31/rxd0 the pin functions are switched as shown below according to the combination of the re bit in scr_0 of sci_0 and the p31ddr bit. re 01 p31ddr 01 ? pin functions p31 input pin p31 output pin * rxd0 input note: * when p31odr is set to 1, it functions as nmos open drain output.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 321 of 982 rej09b0054-0500 ? p30/txd0 the pin functions are switched as shown below according to the combination of the te bit in scr_0 of sci_0 and the p30ddr bit. te 01 p30ddr 01 ? pin functions p30 input pin p30 output pin * txd0 output * note: * when p30odr is set to 1, it functions as nmos open drain output. 10.3 port 4 port 4 is an 8-bit input port and has the following register. ? port 4 register (port4) 10.3.1 port 4 register (port4) port4 shows port 4 pin states. bit bit name initial value r/w description 7p47 ? * r 6p46 ? * r 5p45 ? * r 4p44 ? * r 3p43 ? * r 2p42 ? * r 1p41 ? * r 0p40 ? * r the pin states are always read when a port 4 read is performed. note: * determined by the states of pins p47 to p40. 10.3.2 pin functions port 4 pins also function as a/d converter analog input pins (an7 to an0).
section 10 i/o ports rev. 5.00 aug 08, 2006 page 322 of 982 rej09b0054-0500 10.4 port 7 port 7 is an 8-bit i/o port and has the following registers. ? port 7 data direction register (p7ddr) ? port 7 data register (p7dr) ? port 7 register (port7) 10.4.1 port 7 data direction register (p7ddr) p7ddr specifies input or output of the port 7 pins using the individual bits. p7ddr cannot be read; if it is, an undefined value will be read. this register is a write-only register, and cannot be written by bit manipulation instruction. for details, see section 2.9.4, access methods for registers with write-only bits. bit bit name initial value r/w description 7 p77ddr 0 w 6 p76ddr 0 w 5 p75ddr 0 w 4 p74ddr 0 w 3 p73ddr 0 w 2 p72ddr 0 w 1 p71ddr 0 w 0 p70ddr 0 w when a pin is specified as a general purpose i/o port, setting this bit to 1 makes the corresponding port 7 pin an output pin. clearing this bit to 0 makes the pin an input pin.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 323 of 982 rej09b0054-0500 10.4.2 port 7 data register (p7dr) p7dr stores output data for port 7 pins. bit bit name initial value r/w description 7 p77dr 0 r/w 6 p76dr 0 r/w 5 p75dr 0 r/w 4 p74dr 0 r/w 3 p73dr 0 r/w 2 p72dr 0 r/w 1 p71dr 0 r/w 0 p70dr 0 r/w output data for a pin is stored when the pin is specified as a general purpose i/o port. 10.4.3 port 7 register (port7) port7 shows the pin states. this register cannot be modified. bit bit name initial value r/w description 7p77 ? * r 6p76 ? * r 5p75 ? * r 4p74 ? * r 3p73 ? * r 2p72 ? * r 1p71 ? * r 0p70 ? * r if a port 1 read is performed while p7ddr bits are set to 1, the p7dr values are read. if a port 1 read is performed while p7ddr bits are cleared to 0, the pin states are read. note: * determined by the states of pins p77 to p70.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 324 of 982 rej09b0054-0500 10.4.4 pin functions port 7 pins also function as tmr i/o pins (tmr_0, tmr_1, tmr_2* 1 , and tmr_3* 1 ), bus control output pin, sci i/o pins, and dmac* 2 i/o pins. values of the register and pin functions are shown below. notes: 1. not available in the h8s/2237 group and h8s/2227 group. 2. supported only by the h8s/2239 group. ? p77/txd3 the pin functions are switched as shown below according to the combination of the te bit in scr_3 of sci_3 and the p77ddr bit. te 0 1 p77ddr 0 1 ? pin functions p77 input pin p77 output pin txd3 output ? p76/rxd3 the pin functions are switched as shown below according to the combination of the re bit in scr_3 of sci_3 and the p76ddr bit. re 0 1 p76ddr 0 1 ? pin functions p76 input pin p76 output pin rxd3 input ? p75/tmo3/sck3 the pin functions are switched as shown below according to the combination of os3 to os0 bits in tcsr_3 of tmr_3*, cke1 and cke0 bits in scr_3 of sci_3, the c/a bit in smr_3, and the p75ddr bit. os3 to os0 * all bits are 0 any bit is 1 cke1 0 1 ? c/ a 01 ?? cke0 0 1 ??? p75ddr 0 1 ???? pin functions p75 input pin p75 output pin sck3 output pin sck3 output pin sck3 input pin tmo3 * output pin note: * not available in the h8s/2237 group and h8s/2227 group.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 325 of 982 rej09b0054-0500 ? p74/tmo2/ mres the pin functions are switched as shown below according to the combination of os3 to os0 bits in tcsr_2 of tmr_2*, the mrese bit in syscr, and the p74ddr bit. mrese 0 1 os3 to os0 * all bits are 0 any bit is 1 ? p74ddr 0 1 ? 0 pin functions p74 input pin p74 output pin tmo2 * output mres input note: * not available in the h8s/2237 group and h8s/2227 group. ? p73/tmo1/ tend1 / cs7 the pin functions are switched as shown below according to the combination of operating mode, the tee1 bit in dmatcr of dmac*, os3 to os0 bits in tcsr_1 of tmr_1, and the p73ddr bit. operating mode modes 4 to 6 mode 7 tee1 * 0101 os3 to os0 all bits are 0 any bit is 1 ? all bits are 0 any bit is 1 ? p73ddr 0 1 ?? 01 ?? pin functions p73 input pin cs7 output pin tmo1 output pin tend1 * output pin p73 input pin p73 output pin tmo1 output pin tend1 * output pin note: * supported only by the h8s/2239 group. ? p72/tmo0/ tend0 / cs6 the pin functions are switched as shown below according to the combination of operating mode the tee0 bit in dmatcr of dmac*, os3 to os0 bits in tcsr_0 of tmr_0, and the p72ddr bit. operating mode modes 4 to 6 mode 7 tee0 * 0101 os3 to os0 all bits are 0 any bit is 1 ? all bits are 0 any bit is 1 ? p72ddr 0 1 ??? ?? pin functions p72 input pin cs6 output pin tmo0 output pin tend0 * output pin p72 input pin p72 output pin tmo0 output pin tend0 * output pin note: * supported only by the h8s/2239 group.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 326 of 982 rej09b0054-0500 ? p71/tmri23/tmci23/ dreq1 / cs5 the pin functions are switched as shown below according to the combination of operating mode and the p71ddr bit. operating mode modes 4 to 6 mode 7 p71ddr0101 p71 input pin cs5 output pin p71 input pin p71 output pin pin functions tmri23 * 1 , tmci23 * 1 , dreq1 * 2 input pin ? tmri23 * 1 , tmci23 * 1 , dreq1 * 2 input pin notes: 1. not available in the h8s/2237 group and h8s/2227 group. 2. supported only by the h8s/2239 group. ? p70/tmri01/tmci01/ dreq0 / cs4 the pin functions are switched as shown below according to the combination of operating mode and the p70ddr bit. operating mode modes 4 to 6 mode 7 p70ddr0101 p70 input pin cs4 output pin p70 input pin p70 output pin pin functions tmri01,tmci01, dreq0 * input pin ? tmri01,tmci01, dreq0 * input pin note: * supported only by the h8s/2239 group.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 327 of 982 rej09b0054-0500 10.5 port 9 port 9 is a 2-bit input-only port and has the following register. ? port 9 register (port9) 10.5.1 port 9 register (port9) port9 shows port 9 pin states. this register cannot be modified. bit bit name initial value r/w description 7p97 ? * r 6p96 ? * r the pin states are always read when these bits are read. 5 to 0 ?? r reserved these bits are always read as undefined value. note: * determined by the states of pins p97 and p96. 10.5.2 pin functions port 9 pins also function as d/a converter analog output pins (da1 and da0)*. note: * not available in the h8s/2227 group.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 328 of 982 rej09b0054-0500 10.6 port a port a is a 4-bit i/o port and has the following register. ? port a data direction register (paddr) ? port a data register (padr) ? port a register (porta) ? port a pull-up mos control register (papcr) ? port a open drain control register (paodr) 10.6.1 port a data direction register (paddr) paddr specifies input or output the port a pins using the individual bits. paddr cannot be read; if it is, an undefined value will be read. this register is a write-only register, and cannot be written by bit manipulation instruction. for details, see section 2.9.4, access methods for registers with write-only bits. bit bit name initial value r/w description 7 to 4 ? undefined ? reserved these bits are always read as undefined value. 3 pa3ddr 0 w 2 pa2ddr 0 w 1 pa1ddr 0 w 0 pa0ddr 0w when a pin is specified as a general purpose i/o port, setting this bit to 1 makes the corresponding port a pin an output pin. clearing this bit to 0 makes the pin an input pin. 10.6.2 port a data register (padr) padr stores output data for port a pins. bit bit name initial value r/w description 7 to 4 ? undefined ? reserved these bits are always read as undefined value. 3 pa3dr 0 r/w 2 pa2dr 0 r/w 1 pa1dr 0 r/w 0 pa0dr 0r/w output data for a pin is stored when the pin is specified as a general purpose i/o port.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 329 of 982 rej09b0054-0500 10.6.3 port a register (porta) porta shows the pin states. this register cannot be modified. bit bit name initial value r/w description 7 to 4 ? undefined ? reserved these bits are always read as undefined value. 3 pa3 ? * r 2 pa2 ? * r 1 pa1 ? * r 0 pa0 ? * r if this bit is read while paddr is set to 1, the padr value is read. if this bit is read while paddr is cleared, the pa3 pin states are read. note: * determined by the states of pa3 to pa0 pins. 10.6.4 port a pull-up mos control register (papcr) papcr controls the on/off state of port a input pull-up mos. bit bit name initial value r/w description 7 to 4 ? undefined ? reserved these bits are always read as undefined value. 3 pa3pcr 0 r/w 2 pa2pcr 0 r/w 1 pa1pcr 0 r/w 0 pa0pcr 0 r/w when the pin is specified as an input port, setting the corresponding bit to 1 turns on the input pull-up mos for that pin. 10.6.5 port a open drain control register (paodr) paodr selects output state of port a. bit bit name initial value r/w description 7 to 4 ? undefined ? reserved these bits are always read as undefined value. 3 paodr 0 r/w 2 paodr 0 r/w 1 paodr 0 r/w 0 paodr 0 r/w when this bit is set to 1, the corresponding port a pin functions as open drain output. when this bit is cleared to 0, the corresponding pin functions as cmos output.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 330 of 982 rej09b0054-0500 10.6.6 pin functions port a pins also function as an address output pin and sci_2* i/o pins. the relationship between the value of register and pin is shown as below. note: * not available in the h8s/2227 group. ? pa3/a19/sck2 the pin functions are switched as shown below according to the combination of operating mode, ae3 to ae0 bits in pfcr, the c/a in smr_2 of sci_2 * 2 , cke1 and cke0 bits in scr_2, and the pa3ddr bit. operating mode modes 4 to 6 ae3 to ae0 b'11xx other than b'11xx cke1 ? 01 c/ a * 2 ? 01? cke0 ? 01?? pa3ddr ? 01??? pin functions a19 output pin pa3 input pin pa3 output pin * 1 sck2 * 2 output pin * 1 sck2 * 2 output pin * 1 sck2 * 2 input pin operating mode mode 7 ae3 to ae0 ? cke1 0 1 c/ a * 2 01 ? cke0 0 1 ?? pa3ddr 0 1 ??? pin functions pa3 input pin pa3 output pin * 1 sck2 * 2 output pin * 1 sck2 * 2 output pin * 1 sck2 * 2 input pin notes: 1. when pa3odr in paodr is set to 1, the corresponding pin functions as nmos open drain output. 2. not available in the h8s/2227 group.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 331 of 982 rej09b0054-0500 ? pa2/a18/rxd2 the pin functions are switched as shown below according to the combination of operating mode, ae3 to ae0 bits in pfcr, the re bit in scr_2 of sci_2 * 2 , and the pa2ddr bit. operating mode modes 4 to 6 mode 7 ae3 to ae0 b'1011 or b'11xx other than (b'1011 or b'11xx) ? re * 2 ? 0101 pa2ddr ? 01 ? 01 ? pin functions a18 output pin pa2 input pin pa2 output pin * 1 rxd2 * 2 input pin pa2 input pin pa2 output pin * 1 rxd2 * 2 input pin notes: 1. when pa2odr in paodr is set to 1, the corresponding pin functions as nmos open drain output. 2. not available in the h8s/2227 group. ? pa1/a17/txd2 the pin functions are switched as shown below according to the combination of operating mode, ae3 to ae0 bits in pfcr, the te bit in scr_2 of sci_2 * 2 , and the pa1ddr bit. operating mode modes 4 to 6 mode 7 ae3 to ae0 b'101x or b'11xx other than (b'101x or b'11xx) ? te * 2 ? 01 0 1 pa1ddr ? 01 ? 01 ? pin functions a17 output pin pa1 input pin pa1 output pin * 1 txd2 * 2 output pin * 1 pa1 input pin pa1 output pin * 1 txd2 * 2 output pin * 1 notes: 1. when pa1odr in paodr is set to 1, the corresponding pin functions as nmos open drain output. 2. not available in the h8s/2227 group.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 332 of 982 rej09b0054-0500 ? pa0/a16 the pin functions are switched as shown below according to the combination of operating mode, ae3 to ae0 bits in pfcr and the pa0ddr bit. operating mode modes 4 to 6 mode 7 ae3 to ae0 other than (b'0xxx or b'1000) b'0xxx or b'1000 ? pa0ddr ? 010 1 pin functions a16 output pin pa0 input pin pa0 output pin * pa0 input pin pa0 output pin * note: * when pa0odr in paodr is set to 1, the corresponding pin functions as nmos open drain output. 10.6.7 input pull-up mos states in port a port a has a built-in input pull-up mos function that can be controlled by software. input pull-up mos can be specified as on or off on an individual bit basis. table 10.2 summarizes the input pull-up mos states. table 10.2 input pull-up mos states in port a pin states power-on reset hardware standby mode manual reset software standby mode in other operations address output, port output, sci output off off off port input, sci input off off on/off on/off on/off legend: off: input pull-up mos is always off. on/off: on when paddr = 0 and papcr = 1; otherwise off. 10.7 port b port b is a 8-bit i/o port. port b has the following registers. ? port b data direction register (pbddr) ? port b data register (pbdr) ? port b register (portb)
section 10 i/o ports rev. 5.00 aug 08, 2006 page 333 of 982 rej09b0054-0500 ? port b pull-up mos control register (pbpcr) 10.7.1 port b data direction register (pbddr) pbddr specifies input or output the port b pins using the individual bits. pbddr cannot be read; if it is, an undefined value will be read. this register is a write-only register, and cannot be written by bit manipulation instruction. for details, see section 2.9.4, access methods for registers with write-only bits. bit bit name initial value r/w description 7 pb7ddr 0 w 6 pb6ddr 0 w 5 pb5ddr 0 w 4 pb4ddr 0 w 3 pb3ddr 0 w 2 pb2ddr 0 w 1 pb1ddr 0 w 0 pb0ddr 0 w when a pin is specified as a general purpose i/o port, setting the bit to 1 makes the corresponding port b pin an output pin. clearing the bit to 0 makes the pin an input pin. 10.7.2 port b data register (pbdr) pbdr stores output data for port b pins. bit bit name initial value r/w description 7 pb7dr 0 r/w 6 pb6dr 0 r/w 5 pb5dr 0 r/w 4 pb4dr 0 r/w 3 pb3dr 0 r/w 2 pb2dr 0 r/w 1 pb1dr 0 r/w 0 pb0dr 0 r/w output data for a pin is stored when the pin is specified as a general purpose i/o port.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 334 of 982 rej09b0054-0500 10.7.3 port b register (portb) portb shows the pin states and cannot be modified. bit bit name initial value r/w description 7 pb7 ? * r 6 pb6 ? * r 5 pb5 ? * r 4 pb4 ? * r 3 pb3 ? * r 2 pb2 ? * r 1 pb1 ? * r 0 pb0 ? * r if these bits are read while the corresponding pbddr bits are set to 1, the pbdr value is read. if these bits are read while pbddr bits are cleared to 0, the pin states are read. note: * determined by the states of pins pb7 to pb0. 10.7.4 port b pull-up mos control register (pbpcr) pbpcr controls the on/off state of port b input pull-up mos. bit bit name initial value r/w description 7 pb7pcr 0 r/w 6 pb6pcr 0 r/w 5 pb5pcr 0 r/w 4 pb4pcr 0 r/w 3 pb3pcr 0 r/w 2 pb2pcr 0 r/w 1 pb1pcr 0 r/w 0 pb0pcr 0 r/w when a pin is specified as an input port, setting the corresponding bit to 1 turns on the input pull-up mos for that pin. 10.7.5 pin functions port b pins also function as tpu i/o pins (tpu_3*, tpu_4*, and tpu_5*) and address output pins. the values of register and pin functions are shown bellow. note: * not available in the h8s/2227 group.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 335 of 982 rej09b0054-0500 ? pb7/a15/tiocb5 the pin functions are switched as shown below according to the combination of operating mode, the tpu channel 5 * 3 setting, ae3 to ae0 bits in pfcr, and the pb7ddr bit. operating mode modes 4 to 6 mode 7 ae3 to ae0 b'1xxx other than b'1xxx ? tpu channel 5 setting * 1 * 3 ? output input or initial value output input or initial value pb7ddr ?? 01 ? 01 pb7 input pin pb7 output pin pb7 input pin pb7 output pin pin functions a15 output pin tiocb5 * 3 output pin tiocb5 * 3 input pin * 2 tiocb5 * 3 output pin tiocb5 * 3 input pin * 2 notes: 1. for the setting of the tpu channel, see section 11, 16-bit timer pulse unit (tpu). 2. this pin functions as tiocb5 input when tpu channel 5 timer operating mode is set to normal operating or phase counting mode and iob3 in tior_5 is set to 1. 3. not available in the h8s/2227 group. ? pb6/a14/tioca5 the pin functions are switched as shown below according to the combination of operating mode, the tpu channel 5 * 3 setting, ae3 to ae0 bits in pfcr, and the pb6ddr bit. operating mode modes 4 to 6 mode 7 ae3 to ae0 b'0111 or b'1xxx other than (b'0111 or b'1xxx) ? tpu channel 5 setting * 1 * 3 ? output input or initial value output input or initial value pb6ddr ?? 01 ? 01 pb6 input pin pb6 output pin pb6 input pin pb6 output pin pin functions a14 output pin tioca5 * 3 output pin tioca5 * 3 input pin * 2 tioca5 * 3 output pin tioca5 * 3 input pin * 2 notes: 1. for the setting of the tpu channel, see section 11, 16-bit timer pulse unit (tpu). 2. this pin functions as tioca5 input when tpu channel 5 timer operating mode is set to normal operating or phase counting mode and ioa3 in tior_5 is set to 1. 3. not available in the h8s/2227 group.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 336 of 982 rej09b0054-0500 ? pb5/a13/tiocb4 the pin functions are switched as shown below according to the combination of operating mode, the tpu channel 4 * 3 setting, ae3 to ae0 bits in pfcr, and the pb5ddr bit. operating mode modes 4 to 6 mode 7 ae3 to ae0 b'011x or b'1xxx other than (b'011x or b'1 xxx) ? tpu channel 4 setting * 1 * 3 ? output input or initial value output input or initial value pb5ddr ?? 01 ? 01 pb5 input pin pb5 output pin pb5 input pin pb5 output pin pin functions a13 output pin tiocb4 * 3 output pin tiocb4 * 3 input pin * 2 tiocb4 * 3 output pin tiocb4 * 3 input pin * 2 notes: 1. for the setting of the tpu channel, see section 11, 16-bit timer pulse unit (tpu). 2. this pin functions as tiocb4 input when tpu channel 4 timer operating mode is set to normal operating or phase counting mode and iob3 to iob0 in tior_4 are set to 10xx. 3. not available in the h8s/2227 group. ? pb4/a12/tioca4 the pin functions are switched as shown below according to the combination of operating mode, the tpu channel 4 * 3 setting, ae3 to ae0 bits in pfcr, and the pb4ddr bit. operating mode modes 4 to 6 mode 7 ae3 to ae0 other than (b'0100 or b'00xx) b'0100 or b'00xx ? tpu channel 4 setting * 1 * 3 ? output input or initial value output input or initial value pb4ddr ?? 01 ? 01 pb4 input pin pb4 output pin pb4 input pin pb4 output pin pin functions a12 output pin tioca4 * 3 output pin tioca4 * 3 input pin * 2 tioca4 * 3 output pin tioca4 * 3 input pin * 2 notes: 1. for the setting of the tpu channel, see section 11, 16-bit timer pulse unit (tpu). 2. this pin functions as tioca4 input when tpu channel 4 timer operating mode is set to normal operating or phase counting mode and ioa3 to ioa0 in tior_4 are set to 10xx. 3. not available in the h8s/2227 group.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 337 of 982 rej09b0054-0500 ? pb3/a11/tiocd3 the pin function is switched as shown below according to combination of the operating mode, the tpu channel 3 * 3 setting, ae3 to ae0 bits in pfcr, and the pb3ddr bit. operating mode modes 4 to 6 mode 7 ae3 to ae0 other than b'00xx b'00xx ? tpu channel 3 setting * 1 * 3 ? output input or initial value output input or initial value pb3ddr ?? 01 ? 01 pb3 input pin pb3 output pin pb3 input pin pb3 output pin pin functions a11 output pin tiocd3 * 3 output pin tiocd3 * 3 input pin * 2 tiocd3 * 3 output pin tiocd3 * 3 input pin * 2 notes: 1. for the setting of the tpu channel, see section 11, 16-bit timer pulse unit (tpu). 2. this pin functions as tiocd3 input when tpu channel 3 timer operating mode is set to normal operating and iod3 to iod0 in tiorl_3 are set to 10xx. 3. not available in the h8s/2227 group. ? pb2/a10/tiocc3 the pin functions are switched as shown below according to the combination of operating mode, the tpu channel 3 * 3 setting, ae3 to ae0 bits in pfcr, and the pb2ddr bit. operating mode modes 4 to 6 mode 7 ae3 to ae0 other than (b'0010 or b'000x) b'0010 or b'000x ? tpu channel 3 setting * 1 * 3 ? output input or initial value output input or initial value pb2ddr ?? 01 ? 01 pb2 input pin pb2 output pin pb2 input pin pb2 output pin pin functions a10 output pin tiocc3 * 3 output pin tiocc3 * 3 input pin * 2 tiocc3 * 3 output pin tiocc3 * 3 input pin * 2 notes: 1. for the setting of the tpu channel, see section 11, 16-bit timer pulse unit (tpu). 2. this pin functions as tiocc3 input when tpu channel 3 timer operating mode is set to normal operating mode and ioc3 to ioc0 in tiorl_3 are set to 10xx. 3. not available in the h8s/2227 group.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 338 of 982 rej09b0054-0500 ? pb1/a9/tiocb3 the pin functions are switched as shown below according to the combination of operating mode, the tpu channel 3 * 3 setting, ae3 to ae0 bits in pfcr, and the pb1ddr bit. operating mode modes 4 to 6 mode 7 ae3 to ae0 other than b'000x b'000x ? tpu channel 3 setting * 1 * 3 ? output input or initial value output input or initial value pb1ddr ?? 01 ? 01 pb1 input pin pb1 output pin pb1 input pin pb1 output pin pin functions a9 output pin tiocb3 * 3 output pin tiocb3 * 3 input pin * 2 tiocb3 * 3 output pin tiocb3 * 3 input pin * 2 notes: 1. for the setting of the tpu channel, see section 11, 16-bit timer pulse unit (tpu). 2. this pin functions as tiocb3 input when tpu channel 3 timer operating mode is set to normal operating mode and iob3 to iob0 in tiorh_3 are set to 10xx. 3. not available in the h8s/2227 group. ? pb0/a8/tioca3 the pin functions are switched as shown below according to the combination of the operating mode, tpu channel 3 * 3 setting, the ae3 to ae0 bits in pfcr, and the pb0ddr bit. operating mode modes 4 to 6 mode 7 ae3 to ae0 other than b'0000 b'0000 ? tpu channel 3 setting * 1 * 3 ? output input or initial value output input or initial value pb0ddr ?? 01 ? 01 pb0 input pin pb0 output pin pb0 input pin pb0 output pin pin functions a8 output pin tioca3 * 3 output pin tioca3 * 3 input pin * 2 tioca3 * 3 output pin tioca3 * 3 input pin * 2 notes: 1. for the setting of the tpu channel, see section 11, 16-bit timer pulse unit (tpu). 2. this pin functions as tioca3 input when tpu channel 3 timer operating mode is set to normal operating mode and ioa3 to ioa0 in tiorh_3 are set to 10xx. 3. not available in the h8s/2227 group.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 339 of 982 rej09b0054-0500 10.7.6 input pull-up mos states in port b port b has a built-in input pull-up mos function that can be controlled by software. input pull-up mos can be specified as on or off on an individual bit basis. table 10.3 summarizes the input pull-up mos states. table 10.3 input pull-up mos states in port b pin states power-on reset hardware standby mode manual reset software standby mode in other operations address output, port output, tpu output off off off port input, tpu input off off on/off on/off on/off legend: off: input pull-up mos is always off. on/off: on when pbddr = 0 and pbpcr = 1; otherwise off. 10.8 port c port c is an 8-bit i/o port and has the following registers. ? port c data direction register (pcddr) ? port c data register (pcdr) ? port c register (portc) ? port c pull-up mos control register (pcpcr)
section 10 i/o ports rev. 5.00 aug 08, 2006 page 340 of 982 rej09b0054-0500 10.8.1 port c data direction register (pcddr) pcddr specifies input or output the port c pins using the individual bits. pcddr cannot be read; if it is, an undefined value will be read. this register is a write-only register, and cannot be written by bit manipulation instruction. for details, see section 2.9.4, access methods for registers with write-only bits. bit bit name initial value r/w description 7 pc7ddr 0 w 6 pc6ddr 0 w 5 pc5ddr 0 w 4 pc4ddr 0 w 3 pc3ddr 0 w 2 pc2ddr 0 w 1 pc1ddr 0 w 0 pc0ddr 0 w when a pin is specified as a general purpose i/o port, setting this bit to 1 makes the corresponding port c pin an output pin. clearing this bit to 0 makes the pin an input pin. 10.8.2 port c data register (pcdr) pcdr stores output data for port c pins. bit bit name initial value r/w description 7 pc7dr 0 r/w 6 pc6dr 0 r/w 5 pc5dr 0 r/w 4 pc4dr 0 r/w 3 pc3dr 0 r/w 2 pc2dr 0 r/w 1 pc1dr 0 r/w 0 pc0dr 0 r/w output data for a pin is stored when the pin is specified as a general purpose i/o port.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 341 of 982 rej09b0054-0500 10.8.3 port c register (portc) portc shows port c pin states. this register cannot be modified. bit bit name initial value r/w description 7pc7 ? * r 6pc6 ? * r 5pc5 ? * r 4pc4 ? * r 3pc3 ? * r 2pc2 ? * r 1pc1 ? * r 0pc0 ? * r if a port c read is performed while pcddr bits are set to 1, the pcdr values are read. if a port c read is performed while pcddr bits are cleared to 0, the pin states are read. note: * determined by the states of pins pc7 to pc0. 10.8.4 port c pull-up mos control register (pcpcr) pcpcr controls the input pull-up mos specification as on or off for port c. bit bit name initial value r/w description 7 pc7pcr 0 r/w 6 pc6pcr 0 r/w 5 pc5pcr 0 r/w 4 pc4pcr 0 r/w 3 pc3pcr 0 r/w 2 pc2pcr 0 r/w 1 pc1pcr 0 r/w 0 pc0pcr 0 r/w when a pin is specified as an input port, setting the corresponding bit to 1 turns on the input pull-up mos for that pin.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 342 of 982 rej09b0054-0500 10.8.5 pin functions port c pins also function as address output pin. the values of register and pin functions are shown below. ? pc7/a7, pc6/a6, pc5/a5, pc4/a4, pc3/a3, pc2/a2, pc1/a1, pc0/a0 the pin functions are switched as shown below according to the combination of operating mode and the pcnddr bit. operating mode modes 4 and 5 mode 6 mode 7 pcnddr ? 01 0 1 pin functions address output pin pcn input pin address output pin pcn input pin pcn output pin note: n = 7 to 0 10.8.6 input pull-up mos states in port c port c has a built-in input pull-up mos function that can be controlled by software. input pull-up mos can be used in modes 6 and 7 and specified as on or off on an individual bit basis. table 10.4 summarizes the input pull-up mos states in port c. table 10.4 input pull-up mos states in port c pin states power-on reset hardware standby mode software standby mode in other operations address output (modes 4 and 5) and port output (modes 6 and 7) off off off off port input (modes 6 and 7) on/off on/off legend: off: input pull-up mos is always off. on/off: on when pcddr = 0 and pcpcr = 1; otherwise off.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 343 of 982 rej09b0054-0500 10.9 port d port d is an 8-bit i/o port and has the following registers. ? port d data direction register (pdddr) ? port d data register (pddr) ? port d register (portd) ? port d pull-up mos control register (pdpcr) 10.9.1 port d data direction register (pdddr) pdddr specifies input or output the port d pins using the individual bits. pdddr cannot be read; if it is, an undefined value will be read. this register is a write-only register, and cannot be written by bit manipulation instruction. for details, see section 2.9.4, access methods for registers with write-only bits. bit bit name initial value r/w description 7 pd7ddr 0 w 6 pd6ddr 0 w 5 pd5ddr 0 w 4 pd4ddr 0 w 3 pd3ddr 0 w 2 pd2ddr 0 w 1 pd1ddr 0 w 0 pd0ddr 0 w when a pin is specified as a general purpose i/o port, setting this bit to 1 makes the corresponding port d pin an output port. clearing this bit to 0 makes the pin an input port.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 344 of 982 rej09b0054-0500 10.9.2 port d data register (pddr) pddr stores output data for port d pins. bit bit name initial value r/w description 7 pd7dr 0 r/w 6 pd6dr 0 r/w 5 pd5dr 0 r/w 4 pd4dr 0 r/w 3 pd3dr 0 r/w 2 pd2dr 0 r/w 1 pd1dr 0 r/w 0 pd0dr 0 r/w output data for a pin is stored when the pin is specified as a general purpose i/o port. 10.9.3 port d register (portd) portd shows port d pin states. this register cannot be modified. bit bit name initial value r/w description 7pd7 ? * r 6pd6 ? * r 5pd5 ? * r 4pd4 ? * r 3pd3 ? * r 2pd2 ? * r 1pd1 ? * r 0pd0 ? * r if a port d read is performed while pdddr bits are set to 1, the pddr values are read. if a port d read is performed while pdddr bits are cleared to 0, the pin states are read. note: * determined by the states of pins pd7 to pd0.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 345 of 982 rej09b0054-0500 10.9.4 port d pull-up mos control register (pdpcr) pdpcr controls the on/off state of port d input pull-up mos. bit bit name initial value r/w description 7 pd7pcr 0 r/w 6 pd6pcr 0 r/w 5 pd5pcr 0 r/w 4 pd4pcr 0 r/w 3 pd3pcr 0 r/w 2 pd2pcr 0 r/w 1 pd1pcr 0 r/w 0 pd0pcr 0 r/w when a pin is specified as an input port, setting the corresponding bit to 1 turns on the input pull-up mos for that pin. 10.9.5 pin functions port d pins also function as data i/o pins. the values of register and pin functions are shown below. ? pd7/d15, pd6/d14, pd5/d13, pd4/d12, pd3/d11, pd2/d10, pd1/d9, pd0/d8 the pin functions are switched as shown below according to the combination of the operating mode and the pdnddr bit. operating mode modes 4 to 6 mode 7 pdnddr ? 01 pin functions data i/o pin pdn input pin pdn output pin note: n = 7 to 0
section 10 i/o ports rev. 5.00 aug 08, 2006 page 346 of 982 rej09b0054-0500 10.9.6 input pull-up mos states in port d port d has a built-in input pull-up mos function that can be controlled by software. input pull-up mos can be used in mode 7 and specified as on or off on an individual bit basis. table 10.5 summarizes the input pull-up mos states in port d. table 10.5 input pull-up mos states in port d pin states power-on reset hardware standby mode manual reset software standby mode in other operations data i/o (modes 4 to 6) and port output (mode 7) off off off off off port input (mode 7) on/off on/off on/off legend: off: input pull-up mos is always off. on/off: on when pdddr = 0 and pdpcr = 1; otherwise off. 10.10 port e port e is an 8-bit i/o port and has the following registers. ? port e data direction register (peddr) ? port e data register (pedr) ? port e register (porte) ? port e pull-up mos control register (pepcr)
section 10 i/o ports rev. 5.00 aug 08, 2006 page 347 of 982 rej09b0054-0500 10.10.1 port e data direction register (peddr) peddr specifies input or output of the port e pins using the individual bits. peddr cannot be read; if it is, an undefined value will be read. this register is a write-only register, and cannot be written by bit manipulation instruction. for details, see section 2.9.4, access methods for registers with write-only bits. bit bit name initial value r/w description 7 pe7ddr 0 w 6 pe6ddr 0 w 5 pe5ddr 0 w 4 pe4ddr 0 w 3 pe3ddr 0 w 2 pe2ddr 0 w 1 pe1ddr 0 w 0 pe0ddr 0 w when a pin is specified as a general purpose i/o port, setting this bit to 1 makes the corresponding port e pin an output port. clearing this bit to 0 makes the pin an input port. 10.10.2 port e data register (pedr) pedr stores output data for port e pins. pedr stores output data for port e pins. bit bit name initial value r/w description 7 pe7dr 0 r/w 6 pe6dr 0 r/w 5 pe5dr 0 r/w 4 pe4dr 0 r/w 3 pe3dr 0 r/w 2 pe2dr 0 r/w 1 pe1dr 0 r/w 0 pe0dr 0 r/w output data for a pin is stored when the pin is specified as a general purpose i/o port.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 348 of 982 rej09b0054-0500 10.10.3 port e register (porte) porte shows port e pin states. this register cannot be modified. bit bit name initial value r/w description 7 pe7 ? * r 6 pe6 ? * r 5 pe5 ? * r 4 pe4 ? * r 3 pe3 ? * r 2 pe2 ? * r 1 pe1 ? * r 0 pe0 ? * r if a port e read is performed while peddr bits are set to 1, the pedr values are read. if a port e read is performed while peddr bits are cleared to 0, the pin states are read. note: * determined by the states of pins pe7 to pe0. 10.10.4 port e pull-up mos control register (pepcr) pepcr controls the on/off state of port e input pull-up mos. bit bit name initial value r/w description 7 pe7pcr 0 r/w 6 pe6pcr 0 r/w 5 pe5pcr 0 r/w 4 pe4pcr 0 r/w 3 pe3pcr 0 r/w 2 pe2pcr 0 r/w 1 pe1pcr 0 r/w 0 pe0pcr 0 r/w when a pin is specified as an input port, setting the corresponding bit to 1 turns on the input pull-up mos for that pin.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 349 of 982 rej09b0054-0500 10.10.5 pin functions port e pins also function as data i/o pins. the values of register and pin functions are shown below. ? pe7/d7, pe6/d6, pe5/d5, pe4/d4, pe3/d3, pe2/d2, pe1/d1, pe0/d0 the pin functions are switched as shown below according to the combination of the operating mode, bus mode, and the penddr bit. operating mode modes 4 to 6 mode 7 bus mode 8-bit bus mode 16-bit bus mode ? penddr 0 1 ? 01 pin functions pen input pin pen output pin data i/o pin pen input pin pen output pin note: n = 7 to 0 10.10.6 input pull-up mos states in port e port e has a built-in input pull-up mos function that can be controlled by software. input pull-up mos can be used in modes 4 to 6 and 8-bit bus mode or in mode 7 and specified as on or off on an individual bit basis. table 10.6 summarizes the input pull-up mos states in port e. table 10.6 input pull-up mos states in port e pin states power-on reset hardware standby mode manual reset software standby mode in other operations data i/o (16-bit bus in modes 4 to 6) and port output (8-bit bus in modes 4 to 6, and mode 7) off off off off off port input (8-bit bus in modes 4 to 6, and mode 7) on/off on/off on/off legend: off: input pull-up mos is always off. on/off: on when peddr = 0 and pepcr = 1; otherwise off.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 350 of 982 rej09b0054-0500 10.11 port f port f is an 8-bit i/o port and has the following registers. ? port f data direction register (pfddr) ? port f data register (pfdr) ? port f register (portf) 10.11.1 port f data direction register (pfddr) pfddr specifies input or output of the port f pins using the individual bits. pfddr cannot be read; if it is, an undefined value will be read. this register is a write-only register, and cannot be written by bit manipulation instruction. for details, see section 2.9.4, access methods for registers with write-only bits. bit bit name initial value r/w description 7 pf7ddr 0/1 * w 6 pf6ddr 0 w 5 pf5ddr 0 w 4 pf4ddr 0 w 3 pf3ddr 0 w 2 pf2ddr 0 w 1 pf1ddr 0 w 0 pf0ddr 0 w when a pin is specified as a general purpose i/o port, setting this bit to 1 makes the corresponding port f pin an output port. clearing this bit to 0 makes the pin an input port. note: * in modes 4 to 6, initial value is 1. in mode 7, initial value is 0.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 351 of 982 rej09b0054-0500 10.11.2 port f data register (pfdr) pfdr stores output data for port f pins. pfdr stores output data for port f pins. bit bit name initial value r/w description 7pf7dr 0 r/w 6pf6dr 0 r/w 5pf5dr 0 r/w 4pf4dr 0 r/w 3pf3dr 0 r/w 2pf2dr 0 r/w 1pf1dr 0 r/w 0pf0dr 0 r/w output data for a pin is stored when the pin is specified as a general purpose i/o port. 10.11.3 port f register (portf) portf shows port f pin states. this register cannot be modified. bit bit name initial value r/w description 7pf7 ? * r 6pf6 ? * r 5pf5 ? * r 4pf4 ? * r 3pf3 ? * r 2pf2 ? * r 1pf1 ? * r 0pf0 ? * r if a port f read is performed while pfddr bits are set to 1, the pfdr values are read. if a port f read is performed while pfddr bits are cleared to 0, the pin states are read. note: * determined by the states of pins pf7 to pf0.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 352 of 982 rej09b0054-0500 10.11.4 pin functions port f pins also function as bus control signal input/output pin, interrupt input pin, system clock output pin, a/d trigger input pin, and buzz output pin. the values of register and pin functions are shown below. ? pf7/ the pin functions are switched as shown below according to the pf7ddr bit. pf7ddr 0 1 pin functions pf7 input pin output pin ? pf6/ as the pin functions are switched as shown below according to the combination of operating mode and the pf6ddr bit. operating mode modes 4 to 6 mode 7 pf6ddr ? 01 pin functions as output pin pf6 input pin pf6 output pin ? pf5/ rd the pin functions are switched as shown below according to the combination of operating mode and the pf5ddr bit. operating mode modes 4 to 6 mode 7 pf5ddr ? 01 pin functions rd output pin pf5 input pin pf5 output pin ? pf4/ hwr the pin functions are switched as shown below according to the combination of operating mode and the pf4ddr bit. operating mode modes 4 to 6 mode 7 pf4ddr ? 01 pin functions hwr output pin pf4 input pin pf4 output pin
section 10 i/o ports rev. 5.00 aug 08, 2006 page 353 of 982 rej09b0054-0500 ? pf3/lwr/adtrg/irq3 the pin functions are switched as shown below according to the combination of operating mode and the pf3ddr bit. operating mode modes 4 to 6 mode 7 bus mode 16-bit bus mode 8-bit bus mode ? pf3ddr ? 0101 pf3 input pin pf3 output pin pf3 input pin pf3 output pin adtrg input pin * 1 pin functions lwr output pin irq3 input pin * 2 notes: 1. when trgs0 and trgs1 are set to 1, this pin is adtrg input. 2. when this pin is used as an external interrupt pin, do not specify other functions. ? pf2/ wait the pin functions are switched as shown below according to the combination of operating mode, the waite bit, and the pf2ddr bit. operating mode modes 4 to 6 mode 7 waite 0 1 ? pf2ddr 0 1 ? 01 pin functions pf2 input pin pf2 output pin wait input pin pf2 input pin pf2 output pin ? pf1/ back / buzz the pin functions are switched as shown below according to the combination of operating mode, the buzz bit in pfcr, and the pf1ddr bit. operating mode modes 4 to 6 mode 7 brle 0 1 ? buzze 0 1 ? 01 pf1ddr 0 1 ?? 01 ? pin functions pf1 input pin pf1 output pin buzz output pin back output pin pf1 input pin pf1 output pin buzz output pin
section 10 i/o ports rev. 5.00 aug 08, 2006 page 354 of 982 rej09b0054-0500 ? pf0/breq/ irq2 the pin functions are switched as shown below according to the combination of operating mode, the brle bit, and the pf0ddr bit. operating mode modes 4 to 6 mode 7 brle 0 1 ? pf0ddr 0 1 ? 01 pin functions pf0 input pin pf0 output pin breq input pin pf0 input pin pf0 output pin irq2 input pin * note: * when this pin is used as an external interrupt pin, do not specify other functions. 10.12 port g port g is a 5-bit i/o port and has the following registers. ? port g data direction register (pgddr) ? port g data register (pgdr) ? port g register (portg) 10.12.1 port g data direction register (pgddr) pgddr specifies input or output of the port g pins using the individual bits. pgddr cannot be read; if it is, an undefined value will be read. this register is a write-only register, and cannot be written by bit manipulation instruction. for details, see section 2.9.4, access methods for registers with write-only bits. bit bit name initial value r/w description 7 to 5 ? undefined ? reserved these bits are always read as undefined value. 4 pg4ddr 0/1 * w 3 pg3ddr 0 w 2 pg2ddr 0 w 1 pg1ddr 0 w 0 pg0ddr 0 w when a pin is specified as a general purpose i/o port, setting this bit to 1 makes the corresponding port g pin an output port. clearing this bit to 0 makes the pin an input port. note: * in modes 4 and 5, initial value is 1. in modes 6 and 7, initial value is 0.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 355 of 982 rej09b0054-0500 10.12.2 port g data register (pgdr) pgdr stores output data for port g pins. bit bit name initial value r/w description 7 to 5 ? undefined ? reserved these bits are always read as undefined value. 4pg4dr 0 r/w 3pg3dr 0 r/w 2pg2dr 0 r/w 1pg1dr 0 r/w 0pg0dr 0 r/w output data for a pin is stored when the pin is specified as a general purpose i/o port. 10.12.3 port g register (portg) portg shows port g pin states. this register cannot be modified. bit bit name initial value r/w description 7 to 5 ? undefined ? reserved these bits are always read as undefined value. 4pg4 ? * r 3pg3 ? * r 2pg2 ? * r 1pg1 ? * r 0pg0 ? * r if a port g read is performed while pgddr bits are set to 1, the pgdr values are read. if a port g read is performed while pgddr bits are cleared to 0, the pin states are read. note: * determined by the states of pins pg4 to pg0. 10.12.4 pin functions port g pins also function as ieb* input/output pin, bus control signal input/output pin, and interrupt input pin. the values of registers and pin functions are shown below. note: * supported only by the h8s/2258 group.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 356 of 982 rej09b0054-0500 ? pg4/ cs0 the pin functions are switched as shown below according to the combination of operating mode and the pg4ddr bit. operating mode modes 4 to 6 mode 7 pg4ddr 0 1 0 1 pin functions pg4 input pin cs0 output pin pg4 input pin pg4 output pin ? pg3/ rx / cs1 the pin functions are switched as shown below according to the combination of the iee bit in iectr of ieb*, operating mode, and the pg3ddr bit. iee * 01 operating mode modes 4 to 6 mode 7 ? pg3ddr0101 ? pin functions pg3 input pin cs1 output pin pg3 input pin pg3 output pin rx input pin * note: * supported only by the h8s/2258 group. ? pg2/ tx / cs2 the pin functions are switched as shown below according to the combination of the iee bit in iectr of ieb*, operating mode, and the pg2ddr bit. iee * 01 operating mode modes 4 to 6 mode 7 ? pg2ddr0101 ? pin functions pg2 input pin cs2 output pin pg2 input pin pg2 output pin tx input pin * note: * supported only by the h8s/2258 group.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 357 of 982 rej09b0054-0500 ? pg1/ cs3 / irq7 the pin functions are switched as shown below according to the combination of operating mode and the pg1ddr bit. operating mode modes 4 to 6 mode 7 pg1ddr 0 1 0 1 pg1 input pin cs3 output pin pg1 input pin pg1 output pin pin functions irq7 input pin * note: * when this pin is used as an external interrupt pin, do not specify other functions. ? pg0/ irq6 the pin functions are switched as shown below according to the pg0ddr bit. pg0ddr 0 1 pg0 input pin pg0 output pin pin functions irq6 input pin * note: * when this pin is use as an external interrupt pin, do not specify other functions.
section 10 i/o ports rev. 5.00 aug 08, 2006 page 358 of 982 rej09b0054-0500
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 359 of 982 rej09b0054-0500 section 11 16-bit timer pulse unit (tpu) this lsi has an on-chip 16-bit timer pulse unit (tpu) that comprises three 16-bit timer channels or six 16-bit timer channels. the function list of the 16-bit timer unit and its block diagram are shown in table 11.1 and figure 11.1, respectively. 11.1 features ? the number of channels h8s/2258 group, h8s/2239 group, h8s/2238 group, and h8s/2237 group: six channels (channels 0, 1, 2, 3, 4, and 5) h8s/2227 group: three channels (channels 0, 1, and 2) ? pulse input/output h8s/2258 group, h8s/2239 group, h8s/2238 group, and h8s/2237 group: maximum of 16- pulse input/output h8s/2227 group: maximum of eight-pulse input/output ? selection of 8 counter input clocks for each channel ? the following operations can be set for each channel: waveform output at compare match input capture function counter clear operation synchronous operations: ? multiple timer counters (tcnt) can be written to simultaneously ? simultaneous clearing by compare match and input capture possible ? register simultaneous input/output possible by counter synchronous operation maximum of 15-phase pwm output possible by combination with synchronous operation ? buffer operation settable for channels 0 and 3 ? phase counting mode settable independently for each of channels 1, 2, 4, and 5 ? cascaded operation* ? fast access via internal 16-bit bus ? 26 interrupt sources ? automatic transfer of register data ? a/d converter conversion start trigger can be generated ? module stop mode can be set note: * not available in the h8s/2227 group.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 360 of 982 rej09b0054-0500 table 11.1 tpu functions item channel 0 channel 1 channel 2 channel 3 * 1 channel 4 * 1 channel 5 * 1 count clock /1 /4 /16 /64 tclka tclkb tclkc tclkd /1 /4 /16 /64 /256 tclka tclkb /1 /4 /16 /64 /1024 tclka tclkb tclkc /1 /4 /16 /64 /256 /1024 /4096 tclka /1 /4 /16 /64 /1024 tclka tclkc /1 /4 /16 /64 /256 tclka tclkc tclkd general registers (tgr) tgra_0 tgrb_0 tgra_1 tgrb_1 tgra_2 tgrb_2 tgra_3 tgrb_3 tgra_4 tgrb_4 tgra_5 tgrb_5 general registers/ buffer registers tgrc_0 tgrd_0 ??tgrc_3 tgrd_3 ?? i/o pins tioca0 tiocb0 tiocc0 tiocd0 tioca1 tiocb1 tioca2 tiocb2 tioca3 tiocb3 tiocc3 tiocd3 tioca4 tiocb4 tioca5 tiocb5 counter clear function tgr compare match or input capture tgr compare match or input capture tgr compare match or input capture tgr compare match or input capture tgr compare match or input capture tgr compare match or input capture 0 output o o o o o o 1 output o o o o o o compare match output toggle output oooooo input capture function oooooo synchronous operation oooooo pwm mode oooooo phase counting mode ?oo?oo buffer operation o ? ? o ? ?
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 361 of 982 rej09b0054-0500 item channel 0 channel 1 channel 2 channel 3 channel 4 channel 5 dtc activation tgr compare match or input capture tgr compare match or input capture tgr compare match or input capture tgr compare match or input capture tgr compare match or input capture tgr compare match or input capture dmac * 2 activation tgra_0 compare match or input capture tgra_1 compare match or input capture tgra_2 compare match or input capture tgra_3 compare match or input capture tgra_4 compare match or input capture tgra_5 compare match or input capture a/d converter trigger tgra_0 compare match or input capture tgra_1 compare match or input capture tgra_2 compare match or input capture tgra_3 compare match or input capture tgra_4 compare match or input capture tgra_5 compare match or input capture interrupt sources 5 sources ? compare match or input capture 0a ? compare match or input capture 0b ? compare match or input capture 0c ? compare match or input capture 0d ? overflow 4 sources ? compare match or input capture 1a ? compare match or input capture 1b ? overflow ? underflow 4 sources ? compare match or input capture 2a ? compare match or input capture 2b ? overflow ? underflow 5 sources ? compare match or input capture 3a ? compare match or input capture 3b ? compare match or input capture 3c ? compare match or input capture 3d ? overflow 4 sources ? compare match or input capture 4a ? compare match or input capture 4b ? overflow ? underflow 4 sources ? compare match or input capture 5a ? compare match or input capture 5b ? overflow ? underflow legend: o: possible ? : not possible notes: 1. not available in the h8s/2227 group. 2. supported only by the h8s/2239 group.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 362 of 982 rej09b0054-0500 channel 3 tmdr tiorl tsr tcr tiorh tier tgra tcnt tgrb tgrc tgrd channel 4 tmdr tsr tcr tior tier tgra tcnt tgrb control logic tmdr tsr tcr tior tier tgra tcnt tgrb control logic for channels 3 to 5 tmdr tsr tcr tior tier tgra tcnt tgrb tgrc channel 1 tmdr tsr tcr tior tier tgra tcnt tgrb channel 0 tmdr tsr tcr tiorh tier control logic for channels 0 to 2 tgra tcnt tgrb tgrd tsyr tstr input/output pins tioca3 tiocb3 tiocc3 tiocd3 tioca4 tiocb4 tioca5 tiocb5 clock input /1 /4 /16 /64 /256 /1024 /4096 tclka tclkb tclkc tclkd input/output pins tioca0 tiocb0 tiocc0 tiocd0 tioca1 tiocb1 tioca2 tiocb2 interrupt request signals channel 3: channel 4: channel 5: interrupt request signals channel 0: channel 1: channel 2: internal data bus a/d conversion start request signal tiorl module data bus tgi3a tgi3b tgi3c tgi3d tci3v tgi4a tgi4b tci4v tci4u tgi5a tgi5b tci5v tci5u tgi0a tgi0b tgi0c tgi0d tci0v tgi1a tgi1b tci1v tci1u tgi2a tgi2b tci2v tci2u channel 3: channel 4: channel 5: internal clock: external clock: channel 0: channel 1: channel 2: legend: tstr: timer start register tsyr: timer synchronous register tcr: timer control register tmdr: timer mode register tior (h, l): timer i/o control registers (h, l) tier: timer interrupt enable register tsr: timer status register tgr (a, b, c, d) : timer general registers (a, b, c, d) tcnt: timer counter channel 2 common channel 5 bus interface figure 11.1 block diagram of tpu (h8s/2258 group, h8s/2239 group, h8s/2238 group, and h8s/2237 group)
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 363 of 982 rej09b0054-0500 control logic tmdr tsr tcr tior tier tgra tcnt tgrb tgrc channel 1 tmdr tsr tcr tior tier tgra tcnt tgrb channel 0 tmdr tsr tcr tiorh tier control logic for channels 0 to 2 tgra tcnt tgrb tgrd tsyr tstr clock input /1 /4 /16 /64 /256 /1024 tclka tclkb tclkc tclkd input/output pins tioca0 tiocb0 tiocc0 tiocd0 tioca1 tiocb1 tioca2 tiocb2 interrupt request signals channel 0: channel 1: channel 2: internal data bus a/d conversion start request signal tiorl module data bus tgi0a tgi0b tgi0c tgi0d tci0v tgi1a tgi1b tci1v tci1u tgi2a tgi2b tci2v tci2u internal clock: external clock: channel 0: channel 1: channel 2: legend: tstr: timer start register tsyr: timer synchronous register tcr: timer control register tmdr: timer mode register tior (h, l): timer i/o control registers (h, l) tier: timer interrupt enable register tsr: timer status register tgr (a, b, c, d) : timer general registers (a, b, c, d) channel 2 common bus interface figure 11.2 block diagram of tpu (h8s/2227 group)
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 364 of 982 rej09b0054-0500 11.2 input/output pins table 11.2 pin configuration channel symbol i/o function all tclka input external clock a input pin (channels 1 and 5 * phase counting mode a phase input) tclkb input external clock b input pin (channels 1 and 5 * phase counting mode b phase input) tclkc input external clock c input pin (channels 2 and 4 * phase counting mode a phase input) tclkd input external clock d input pin (channels 2 and 4 * phase counting mode b phase input) 0 tioca0 i/o tgra_0 input capture input/output compare output/pwm output pin tiocb0 i/o tgrb_0 input capture input/output compare output/pwm output pin tiocc0 i/o tgrc_0 input capture input/output compare output/pwm output pin tiocd0 i/o tgrd_0 input capture input/output compare output/pwm output pin 1 tioca1 i/o tgra_1 input capture input/output compare output/pwm output pin tiocb1 i/o tgrb_1 input capture input/output compare output/pwm output pin 2 tioca2 i/o tgra_2 input capture input/output compare output/pwm output pin tiocb2 i/o tgrb_2 input capture input/output compare output/pwm output pin 3 * tioca3 i/o tgra_3 input capture input/output compare output/pwm output pin tiocb3 i/o tgrb_3 input capture input/output compare output/pwm output pin tiocc3 i/o tgrc_3 input capture input/output compare output/pwm output pin tiocd3 i/o tgrd_3 input capture input/output compare output/pwm output pin 4 * tioca4 i/o tgra_4 input capture input/output compare output/pwm output pin tiocb4 i/o tgrb_4 input capture input/output compare output/pwm output pin 5 * tioca5 i/o tgra_5 input capture input/output compare output/pwm output pin tiocb5 i/o tgrb_5 input capture input/output compare output/pwm output pin note: * not available in the h8s/2227 group.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 365 of 982 rej09b0054-0500 11.3 register descriptions the tpu has the following registers in each channel. ? timer control register_0 (tcr_0) ? timer mode register_0 (tmdr_0) ? timer i/o control register h_0 (tiorh_0) ? timer i/o control register l_0 (tiorl_0) ? timer interrupt enable register_0 (tier_0) ? timer status register_0 (tsr_0) ? timer counter_0 (tcnt_0) ? timer general register a_0 (tgra_0) ? timer general register b_0 (tgrb_0) ? timer general register c_0 (tgrc_0) ? timer general register d_0 (tgrd_0) ? timer control register_1 (tcr_1) ? timer mode register_1 (tmdr_1) ? timer i/o control register _1 (tior_1) ? timer interrupt enable register_1 (tier_1) ? timer status register_1 (tsr_1) ? timer counter_1 (tcnt_1) ? timer general register a_1 (tgra_1) ? timer general register b_1 (tgrb_1) ? timer control register_2 (tcr_2) ? timer mode register_2 (tmdr_2) ? timer i/o control register_2 (tior_2) ? timer interrupt enable register_2 (tier_2) ? timer status register_2 (tsr_2) ? timer counter_2 (tcnt_2) ? timer general register a_2 (tgra_2) ? timer general register b_2 (tgrb_2) ? timer control register_3 (tcr_3)* ? timer mode register_3 (tmdr_3)* ? timer i/o control register h_3 (tiorh_3)* ? timer i/o control register l_3 (tiorl_3)*
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 366 of 982 rej09b0054-0500 ? timer interrupt enable register_3 (tier_3)* ? timer status register_3 (tsr_3)* ? timer counter_3 (tcnt_3)* ? timer general register a_3 (tgra_3)* ? timer general register b_3 (tgrb_3)* ? timer general register c_3 (tgrc_3)* ? timer general register d_3 (tgrd_3)* ? timer control register_4 (tcr_4)* ? timer mode register_4 (tmdr_4)* ? timer i/o control register _4 (tior_4)* ? timer interrupt enable register_4 (tier_4)* ? timer status register_4 (tsr_4)* ? timer counter_4 (tcnt_4)* ? timer general register a_4 (tgra_4)* ? timer general register b_4 (tgrb_4)* ? timer control register_5 (tcr_5)* ? timer mode register_5 (tmdr_5)* ? timer i/o control register_5 (tior_5)* ? timer interrupt enable register_5 (tier_5)* ? timer status register_5 (tsr_5)* ? timer counter_5 (tcnt_5)* ? timer general register a_5 (tgra_5)* ? timer general register b_5 (tgrb_5)* common registers ? timer start register (tstr) ? timer synchronous register (tsyr) note: * not available in the h8s/2227 group.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 367 of 982 rej09b0054-0500 11.3.1 timer control register (tcr) the tcr registers control the tcnt operation for each channel. the tpu of the h8s/2227 group has a total of three tcr registers, one each for channels 0 to 2. in other groups, the tpu has a total of six tcr registers, one each for channels 0 to 5. tcr register settings should be made only when tcnt operation is stopped. bit bit name initial value r/w description 7 6 5 cclr2 cclr1 cclr0 0 0 0 r/w r/w r/w counter clear 2 to 0 these bits select the tcnt counter clearing source. see tables 11.3 and 11.4 for details. 4 3 ckeg1 ckeg0 0 0 r/w r/w clock edge 1 and 0 these bits select the input clock edge. when the input clock is counted using both edges, the input clock period is halved (e.g. /4 both edges = /2 rising edge). if phase counting mode is used on channels 1, 2, 4 * , and 5 * , this setting is ignored and the phase counting mode setting has priority. internal clock edge selection is valid when the input clock is /4 or slower. this setting is ignored if the input clock is /1, or when overflow/underflow of another channel is selected. 00: count at rising edge 01: count at falling edge 1 : count at both edges legend: : don?t care 2 1 0 tpsc2 tpsc1 tpsc0 0 0 0 r/w r/w r/w time prescaler 2 to 0 these bits select the tcnt counter clock. the clock source can be selected independently for each channel. see tables 11.5 to 11.10 for details. note: * not available in the h8s/2227 group.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 368 of 982 rej09b0054-0500 table 11.3 cclr2 to cclr0 (channels 0 and 3) channel bit 7 cclr2 bit 6 cclr1 bit 5 cclr0 description 0, 3 * 3 0 0 0 tcnt clearing disabled 1 tcnt cleared by tgra compare match/input capture 1 0 tcnt cleared by tgrb compare match/input capture 1 tcnt cleared by counter clearing for another channel performing synchronous clearing/ synchronous operation * 1 1 0 0 tcnt clearing disabled 1 tcnt cleared by tgrc compare match/input capture * 2 1 0 tcnt cleared by tgrd compare match/input capture * 2 1 tcnt cleared by counter clearing for another channel performing synchronous clearing/ synchronous operation * 1 notes: 1. synchronous operation setting is performed by setting the sync bit in tsyr to 1. 2. when tgrc or tgrd is used as a buffer register, tcnt is not cleared because the buffer register setting has priority, and compare match/input capture does not occur. 3. not available in the h8s/2227 group. table 11.4 cclr2 to cclr0 (channels 1, 2, 4, and 5) channel bit 7 reserved * 2 bit 6 cclr1 bit 5 cclr0 description 0 0 0 tcnt clearing disabled 1, 2, 4 * 3 , 5 * 3 1 tcnt cleared by tgra compare match/input capture 1 0 tcnt cleared by tgrb compare match/input capture 1 tcnt cleared by counter clearing for another channel performing synchronous clearing/ synchronous operation * 1 notes: 1. synchronous operation setting is performed by setting the sync bit in tsyr to 1. 2. bit 7 is reserved in channels 1, 2, 4, and 5. it is always read as 0 and cannot be modified. 3. not available in the h8s/2227 group.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 369 of 982 rej09b0054-0500 table 11.5 tpsc2 to tpsc0 (channel 0) channel bit 2 tpsc2 bit 1 tpsc1 bit 0 tpsc0 description 0 0 0 0 internal clock: counts on /1 1 internal clock: counts on /4 1 0 internal clock: counts on /16 1 internal clock: counts on /64 1 0 0 external clock: counts on tclka pin input 1 external clock: counts on tclkb pin input 1 0 external clock: counts on tclkc pin input 1 external clock: counts on tclkd pin input table 11.6 tpsc2 to tpsc0 (channel 1) channel bit 2 tpsc2 bit 1 tpsc1 bit 0 tpsc0 description 1 0 0 0 internal clock: counts on /1 1 internal clock: counts on /4 1 0 internal clock: counts on /16 1 internal clock: counts on /64 1 0 0 external clock: counts on tclka pin input 1 external clock: counts on tclkb pin input 1 0 internal clock: counts on /256 1 counts on tcnt2 overflow/underflow setting is prohibited in the h8s/2227 group. note: this setting is ignored when channel 1 is in phase counting mode.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 370 of 982 rej09b0054-0500 table 11.7 tpsc2 to tpsc0 (channel 2) channel bit 2 tpsc2 bit 1 tpsc1 bit 0 tpsc0 description 2 0 0 0 internal clock: counts on /1 1 internal clock: counts on /4 1 0 internal clock: counts on /16 1 internal clock: counts on /64 1 0 0 external clock: counts on tclka pin input 1 external clock: counts on tclkb pin input 1 0 external clock: counts on tclkc pin input 1 internal clock: counts on /1024 note: this setting is ignored when channel 2 is in phase counting mode. table 11.8 tpsc2 to tpsc0 (channel 3) channel bit 2 tpsc2 bit 1 tpsc1 bit 0 tpsc0 description 3 * 0 0 0 internal clock: counts on /1 1 internal clock: counts on /4 1 0 internal clock: counts on /16 1 internal clock: counts on /64 1 0 0 external clock: counts on tclka pin input 1 internal clock: counts on /1024 1 0 internal clock: counts on /256 1 internal clock: counts on /4096 note: * not available in the h8s/2227 group.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 371 of 982 rej09b0054-0500 table 11.9 tpsc2 to tpsc0 (channel 4) channel bit 2 tpsc2 bit 1 tpsc1 bit 0 tpsc0 description 4 * 0 0 0 internal clock: counts on /1 1 internal clock: counts on /4 1 0 internal clock: counts on /16 1 internal clock: counts on /64 1 0 0 external clock: counts on tclka pin input 1 external clock: counts on tclkc pin input 1 0 internal clock: counts on /1024 1 counts on tcnt5 overflow/underflow notes: this setting is ignored when channel 4 is in phase counting mode. * not available in the h8s/2227 group. table 11.10 tpsc2 to tpsc0 (channel 5) channel bit 2 tpsc2 bit 1 tpsc1 bit 0 tpsc0 description 5 * 0 0 0 internal clock: counts on /1 1 internal clock: counts on /4 1 0 internal clock: counts on /16 1 internal clock: counts on /64 1 0 0 external clock: counts on tclka pin input 1 external clock: counts on tclkc pin input 1 0 internal clock: counts on /256 1 external clock: counts on tclkd pin input notes: this setting is ignored when channel 5 is in phase counting mode. * not available in the h8s/2227 group.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 372 of 982 rej09b0054-0500 11.3.2 timer mode register (tmdr) the tmdr registers are used to set the operating mode for each channel. the tpu of the h8s/2227 group has a total of three tmdr registers, one each for channels 0 to 2. in other groups, the tpu has a total of six tmdr registers, one each for channels 0 to 5. tmdr register settings should be made only when tcnt operation is stopped. bit bit name initial value r/w description 7, 6 ? all 1 ? reserved these bits are always read as 1 and cannot be modified. 5 bfb 0 r/w buffer operation b specifies whether tgrb is to operate in the normal way, or tgrb and tgrd are to be used together for buffer operation. when tgrd is used as a buffer register, tgrd input capture/output compare is not generated. in channels 1, 2, 4 * , and 5 * , which have no tgrd, bit 5 is reserved. it is always read as 0 and cannot be modified. 0: tgrb operates normally 1: tgrb and tgrd used together for buffer operation 4 bfa 0 r/w buffer operation a specifies whether tgra is to operate in the normal way, or tgra and tgrc are to be used together for buffer operation. when tgrc is used as a buffer register, tgrc input capture/output compare is not generated. in channels 1, 2, 4 * , and 5 * , which have no tgrc, bit 4 is reserved. it is always read as 0 and cannot be modified. 0: tgra operates normally 1: tgra and tgrc used together for buffer operation 3 2 1 0 md3 md2 md1 md0 0 0 0 0 r/w r/w r/w r/w modes 3 to 0 these bits are used to set the timer operating mode. md3 is a reserved bit. the write value should always be 0. see table 11.11 for details. note: * not available in the h8s/2227 group.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 373 of 982 rej09b0054-0500 table 11.11 md3 to md0 bit 3 md3 * 1 bit 2 md2 * 2 bit 1 md1 bit 0 md0 description 0 0 0 0 normal operation 1 reserved 1 0 pwm mode 1 1 pwm mode 2 1 0 0 phase counting mode 1 1 phase counting mode 2 1 0 phase counting mode 3 1 phase counting mode 4 1 ? legend: : don?t care notes: 1. md3 is a reserved bit. in a write, it should always be written with 0. 2. phase counting mode cannot be set for channels 0 and 3. in this case, 0 should always be written to md2. 11.3.3 timer i/o control register (tior) the tior registers control the tgr registers. the tpu of the h8s/2227 group has a total of four tior registers, two for channel 0 and one each for channels 1 and 2. in other groups, the tpu has a total of eight tior registers, two each for channels 0 and 3, and one each for channels 1, 2, 4, and 5. care is required since tior is affected by the tmdr setting. the initial output specified by tior is valid when the counter is stopped (the cst bit in tstr is cleared to 0). note also that, in pwm mode 2, the output at the point at which the counter is cleared to 0 is specified. when tgrc or tgrd is designated for buffer operation, this setting is invalid and the register operates as a buffer register.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 374 of 982 rej09b0054-0500 tiorh_0, tior_1, tior_2, tiorh_3 * , tior_4 * , tior_5 * bit bit name initial value r/w description 7 6 5 4 iob3 iob2 iob1 iob0 0 0 0 0 r/w r/w r/w r/w i/o control b3 to b0 specify the function of tgrb. for details, see tables 11.12, 11.14, 11.15, 11.16, 11.18, and 11.19. 3 2 1 0 ioa3 ioa2 ioa1 ioa0 0 0 0 0 r/w r/w r/w r/w i/o control a3 to a0 specify the function of tgra. for details, see tables 11.20, 11.22, 11.23, 11.24, 11.26, and 11.27. note: * not available in the h8s/2227 group. tiorl_0, tiorl_3 * bit bit name initial value r/w description 7 6 5 4 iod3 iod2 iod1 iod0 0 0 0 0 r/w r/w r/w r/w i/o control d3 to d0 specify the function of tgrd. for details, see tables 11.13 and 11.17. 3 2 1 0 ioc3 ioc2 ioc1 ioc0 0 0 0 0 r/w r/w r/w r/w i/o control c3 to c0 specify the function of tgrc. for details, see tables 11.21 and 11.25 note: * not available in the h8s/2227 group.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 375 of 982 rej09b0054-0500 table 11.12 tiorh_0 description bit 7 iob3 bit 6 iob2 bit 5 iob1 bit 4 iob0 tgrb_0 function tiocb0 pin function 0 0 0 0 output disabled 1 output compare register initial output is 0 output 0 output at compare match 1 0 initial output is 0 output 1 output at compare match 1 initial output is 0 output toggle output at compare match 1 0 0 output disabled 1 initial output is 1 output 0 output at compare match 1 0 initial output is 1 output 1 output at compare match 1 initial output is 1 output toggle output at compare match 1 0 0 0 capture input source is tiocb0 pin input capture at rising edge 1 capture input source is tiocb0 pin input capture at falling edge 1 input capture register capture input source is tiocb0 pin input capture at both edges 1 capture input source is channel 1/count clock input capture at tcnt_1 count- up/count- down * 1 * 2 legend: : don?t care notes: 1. when bits tpsc2 to tpsc0 in tcr_1 are set to b'000 and /1 is used as the tcnt_1 count clock, this setting is invalid and input capture is not generated. 2. not available in the h8s/2227 group.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 376 of 982 rej09b0054-0500 table 11.13 tiorl_0 description bit 7 iod3 bit 6 iod2 bit 5 iod1 bit 4 iod0 tgrd_0 function tiocd0 pin function 0 0 0 0 output disabled 1 output compare register * 2 initial output is 0 output 0 output at compare match 1 0 initial output is 0 output 1 output at compare match 1 initial output is 0 output toggle output at compare match 1 0 0 output disabled 1 initial output is 1 output 0 output at compare match 1 0 initial output is 1 output 1 output at compare match 1 initial output is 1 output toggle output at compare match 1 0 0 0 capture input source is tiocd0 pin input capture at rising edge 1 capture input source is tiocd0 pin input capture at falling edge 1 input capture register * 2 capture input source is tiocd0 pin input capture at both edges 1 capture input source is channel 1/count clock input capture at tcnt_1 count-up/count- down * 1 * 3 legend: : don?t care notes: 1. when bits tpsc2 to tpsc0 in tcr_1 are set to b'000 and /1 is used as the tcnt_1 count clock, this setting is invalid and input capture is not generated. 2. when the bfb bit in tmdr_0 is set to 1 and tgrd_0 is used as a buffer register, this setting is invalid and input capture/output compare is not generated. 3. not available in the h8s/2227 group.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 377 of 982 rej09b0054-0500 table 11.14 tior_1 description bit 7 iob3 bit 6 iob2 bit 5 iob1 bit 4 iob0 tgrb_1 function tiocb1 pin function 0 0 0 0 output disabled 1 output compare register initial output is 0 output 0 output at compare match 1 0 initial output is 0 output 1 output at compare match 1 initial output is 0 output toggle output at compare match 1 0 0 output disabled 1 initial output is 1 output 0 output at compare match 1 0 initial output is 1 output 1 output at compare match 1 initial output is 1 output toggle output at compare match 1 0 0 0 capture input source is tiocb1 pin input capture at rising edge 1 capture input source is tiocb1 pin input capture at falling edge 1 input capture register capture input source is tiocb1 pin input capture at both edges 1 tgrc_0 compare match/input capture input capture at generation of tgrc_0 compare match/input capture * legend: : don?t care note: * not available in the h8s/2227 group.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 378 of 982 rej09b0054-0500 table 11.15 tior_2 description bit 7 iob3 bit 6 iob2 bit 5 iob1 bit 4 iob0 tgrb_2 function tiocb2 pin function 0 0 0 0 output disabled 1 output compare register initial output is 0 output 0 output at compare match 1 0 initial output is 0 output 1 output at compare match 1 initial output is 0 output toggle output at compare match 1 0 0 output disabled 1 initial output is 1 output 0 output at compare match 1 0 initial output is 1 output 1 output at compare match 1 initial output is 1 output toggle output at compare match 1 0 0 capture input source is tiocb2 pin input capture at rising edge 1 capture input source is tiocb2 pin input capture at falling edge 1 input capture register capture input source is tiocb2 pin input capture at both edges legend: : don?t care
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 379 of 982 rej09b0054-0500 table 11.16 tiorh_3 description bit 7 iob3 bit 6 iob2 bit 5 iob1 bit 4 iob0 tgrb_3 function * 2 tiocb3 pin function * 2 0 0 0 0 output disabled 1 output compare register initial output is 0 output 0 output at compare match 1 0 initial output is 0 output 1 output at compare match 1 initial output is 0 output toggle output at compare match 1 0 0 output disabled 1 initial output is 1 output 0 output at compare match 1 0 initial output is 1 output 1 output at compare match 1 initial output is 1 output toggle output at compare match 1 0 0 0 capture input source is tiocb3 pin input capture at rising edge 1 capture input source is tiocb3 pin input capture at falling edge 1 input capture register capture input source is tiocb3 pin input capture at both edges 1 capture input source is channel 4/count clock input capture at tcnt_4 count-up/count- down * 1 legend: : don?t care notes: 1. when bits tpsc2 to tpsc0 in tcr_4 are set to b'000 and /1 is used as the tcnt_4 count clock, this setting is invalid and input capture is not generated. 2. not available in the h8s/2227 group.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 380 of 982 rej09b0054-0500 table 11.17 tiorl_3 description bit 7 iod3 bit 6 iod2 bit 5 iod1 bit 4 iod0 tgrd_3 function * 3 tiocd3 pin function * 3 0 0 0 0 output disabled 1 output compare register * 2 initial output is 0 output 0 output at compare match 1 0 initial output is 0 output 1 output at compare match 1 initial output is 0 output toggle output at compare match 1 0 0 output disabled 1 initial output is 1 output 0 output at compare match 1 0 initial output is 1 output 1 output at compare match 1 initial output is 1 output toggle output at compare match 1 0 0 0 capture input source is tiocd3 pin input capture at rising edge 1 capture input source is tiocd3 pin input capture at falling edge 1 input capture register * 2 capture input source is tiocd3 pin input capture at both edges 1 capture input source is channel 4/count clock input capture at tcnt_4 count-up/count- down * 1 legend: : don?t care notes: 1. when bits tpsc2 to tpsc0 in tcr_4 are set to b'000 and /1 is used as the tcnt_4 count clock, this setting is invalid and input capture is not generated. 2. when the bfb bit in tmdr_3 is set to 1 and tgrd_3 is used as a buffer register, this setting is invalid and input capture/output compare is not generated. 3. not available in the h8s/2227 group.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 381 of 982 rej09b0054-0500 table 11.18 tior_4 description bit 7 iob3 bit 6 iob2 bit 5 iob1 bit 4 iob0 tgrb_4 function * tiocb4 pin function * 0 0 0 0 output disabled 1 output compare register initial output is 0 output 0 output at compare match 1 0 initial output is 0 output 1 output at compare match 1 initial output is 0 output toggle output at compare match 1 0 0 output disabled 1 initial output is 1 output 0 output at compare match 1 0 initial output is 1 output 1 output at compare match 1 initial output is 1 output toggle output at compare match 1 0 0 0 capture input source is tiocb4 pin input capture at rising edge 1 capture input source is tiocb4 pin input capture at falling edge 1 input capture register capture input source is tiocb4 pin input capture at both edges 1 capture input source is tgrc_3 compare match/input capture input capture at generation of tgrc_3 compare match/input capture legend: : don?t care note: * not available in the h8s/2227 group.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 382 of 982 rej09b0054-0500 table 11.19 tior_5 description bit 7 iob3 bit 6 iob2 bit 5 iob1 bit 4 iob0 tgrb_5 function * tiocb5 pin function * 0 0 0 0 output disabled 1 output compare register initial output is 0 output 0 output at compare match 1 0 initial output is 0 output 1 output at compare match 1 initial output is 0 output toggle output at compare match 1 0 0 output disabled 1 initial output is 1 output 0 output at compare match 1 0 initial output is 1 output 1 output at compare match 1 initial output is 1 output toggle output at compare match 1 0 0 capture input source is tiocb5 pin input capture at rising edge 1 capture input source is tiocb5 pin input capture at falling edge 1 input capture register capture input source is tiocb5 pin input capture at both edges legend: : don?t care note: * not available in the h8s/2227 group.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 383 of 982 rej09b0054-0500 table 11.20 tiorh_0 description bit 3 ioa3 bit 2 ioa2 bit 1 ioa1 bit 0 ioa0 tgra_0 function tioca0 pin function 0 0 0 0 output disabled 1 output compare register initial output is 0 output 0 output at compare match 1 0 initial output is 0 output 1 output at compare match 1 initial output is 0 output toggle output at compare match 1 0 0 output disabled 1 initial output is 1 output 0 output at compare match 1 0 initial output is 1 output 1 output at compare match 1 initial output is 1 output toggle output at compare match 1 0 0 0 capture input source is tioca0 pin input capture at rising edge 1 capture input source is tioca0 pin input capture at falling edge 1 input capture register capture input source is tioca0 pin input capture at both edges 1 capture input source is channel 1/count clock input capture at tcnt_1 count-up/count-down * legend: : don?t care note: * not available in the h8s/2227 group.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 384 of 982 rej09b0054-0500 table 11.21 tiorl_0 description bit 3 ioc3 bit 2 ioc2 bit 1 ioc1 bit 0 ioc0 tgrc_0 function tiocc0 pin function 0 0 0 0 output disabled 1 output compare register * 1 initial output is 0 output 0 output at compare match 1 0 initial output is 0 output 1 output at compare match 1 initial output is 0 output toggle output at compare match 1 0 0 output disabled 1 initial output is 1 output 0 output at compare match 1 0 initial output is 1 output 1 output at compare match 1 initial output is 1 output toggle output at compare match 1 0 0 0 capture input source is tiocc0 pin input capture at rising edge 1 capture input source is tiocc0 pin input capture at falling edge 1 input capture register * 1 capture input source is tiocc0 pin input capture at both edges 1 capture input source is channel 1/count clock input capture at tcnt_1 count-up/count- down * 2 legend: : don?t care notes: 1. when the bfa bit in tmdr_0 is set to 1 and tgrc_0 is used as a buffer register, this setting is invalid and input capture/output compare is not generated. 2. not available in the h8s/2227 group.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 385 of 982 rej09b0054-0500 table 11.22 tior_1 description bit 3 ioa3 bit 2 ioa2 bit 1 ioa1 bit 0 ioa0 tgra_1 function tioca1 pin function 0 0 0 0 output disabled 1 output compare register initial output is 0 output 0 output at compare match 1 0 initial output is 0 output 1 output at compare match 1 initial output is 0 output toggle output at compare match 1 0 0 output disabled 1 initial output is 1 output 0 output at compare match 1 0 initial output is 1 output 1 output at compare match 1 initial output is 1 output toggle output at compare match 1 0 0 0 capture input source is tioca1 pin input capture at rising edge 1 capture input source is tioca1 pin input capture at falling edge 1 input capture register capture input source is tioca1 pin input capture at both edges 1 capture input source is tgra_0 compare match/input capture input capture at generation of channel 0/tgra_0 compare match/input capture * legend: : don?t care note: * not available in the h8s/2227 group.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 386 of 982 rej09b0054-0500 table 11.23 tior_2 description bit 3 ioa3 bit 2 ioa2 bit 1 ioa1 bit 0 ioa0 tgra_2 function tioca2 pin function 0 0 0 0 output disabled 1 output compare register initial output is 0 output 0 output at compare match 1 0 initial output is 0 output 1 output at compare match 1 initial output is 0 output toggle output at compare match 1 0 0 output disabled 1 initial output is 1 output 0 output at compare match 1 0 initial output is 1 output 1 output at compare match 1 initial output is 1 output toggle output at compare match 1 0 0 capture input source is tioca2 pin input capture at rising edge 1 capture input source is tioca2 pin input capture at falling edge 1 input capture register capture input source is tioca2 pin input capture at both edges legend: : don?t care
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 387 of 982 rej09b0054-0500 table 11.24 tiorh_3 description bit 3 ioa3 bit 2 ioa2 bit 1 ioa1 bit 0 ioa0 tgra_3 function * tioca3 pin function * 0 0 0 0 output disabled 1 output compare register initial output is 0 output 0 output at compare match 1 0 initial output is 0 output 1 output at compare match 1 initial output is 0 output toggle output at compare match 1 0 0 output disabled 1 initial output is 1 output 0 output at compare match 1 0 initial output is 1 output 1 output at compare match 1 initial output is 1 output toggle output at compare match 1 0 0 0 capture input source is tioca3 pin input capture at rising edge 1 capture input source is tioca3 pin input capture at falling edge 1 input capture register capture input source is tioca3 pin input capture at both edges 1 capture input source is channel 4/count clock input capture at tcnt_4 count-up/count-down legend: : don?t care note: * not available in the h8s/2227 group.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 388 of 982 rej09b0054-0500 table 11.25 tiorl_3 description bit 3 ioc3 bit 2 ioc2 bit 1 ioc1 bit 0 ioc0 tgrc_3 function * 2 tiocc3 pin function * 2 0 0 0 0 output disabled 1 output compare register * 1 initial output is 0 output 0 output at compare match 1 0 initial output is 0 output 1 output at compare match 1 initial output is 0 output toggle output at compare match 1 0 0 output disabled 1 initial output is 1 output 0 output at compare match 1 0 initial output is 1 output 1 output at compare match 1 initial output is 1 output toggle output at compare match 1 0 0 0 capture input source is tiocc3 pin input capture at rising edge 1 capture input source is tiocc3 pin input capture at falling edge 1 input capture register * 1 capture input source is tiocc3 pin input capture at both edges 1 capture input source is channel 4/count clock input capture at tcnt_4 count-up/count-down legend: : don?t care notes: 1. when the bfa bit in tmdr_3 is set to 1 and tgrc_3 is used as a buffer register, this setting is invalid and input capture/output compare is not generated. 2. not available in the h8s/2227 group.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 389 of 982 rej09b0054-0500 table 11.26 tior_4 description bit 3 ioa3 bit 2 ioa2 bit 1 ioa1 bit 0 ioa0 tgra_4 function * tioca4 pin function * 0 0 0 0 output disabled 1 output compare register initial output is 0 output 0 output at compare match 1 0 initial output is 0 output 1 output at compare match 1 initial output is 0 output toggle output at compare match 1 0 0 output disabled 1 initial output is 1 output 0 output at compare match 1 0 initial output is 1 output 1 output at compare match 1 initial output is 1 output toggle output at compare match 1 0 0 0 capture input source is tioca4 pin input capture at rising edge 1 capture input source is tioca4 pin input capture at falling edge 1 input capture register capture input source is tioca4 pin input capture at both edges 1 capture input source is tgra_3 compare match/input capture input capture at generation of tgra_3 compare match/input capture legend: : don?t care note: * not available in the h8s/2227 group.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 390 of 982 rej09b0054-0500 table 11.27 tior_5 description bit 3 ioa3 bit 2 ioa2 bit 1 ioa1 bit 0 ioa0 tgra_5 function * tioca5 pin function * 0 0 0 0 output disabled 1 output compare register initial output is 0 output 0 output at compare match 1 0 initial output is 0 output 1 output at compare match 1 initial output is 0 output toggle output at compare match 1 0 0 output disabled 1 initial output is 1 output 0 output at compare match 1 0 initial output is 1 output 1 output at compare match 1 initial output is 1 output toggle output at compare match 1 0 0 input capture source is tioca5 pin input capture at rising edge 1 input capture source is tioca5 pin input capture at falling edge 1 input capture register input capture source is tioca5 pin input capture at both edges legend: : don?t care note: * not available in the h8s/2227 group.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 391 of 982 rej09b0054-0500 11.3.4 timer interrupt enable register (tier) the tier registers control enabling or disabling of interrupt requests for each channel. the tpu of the h8s/2227 group has a total of three tier registers, one each for channels 0 to 2. in other groups, the tpu has a total of six tier registers, one each for channels 0 to 5. bit bit name initial value r/w description 7 ttge 0 r/w a/d conversion start request enable enables or disables generation of a/d conversion start requests by tgra input capture/compare match. 0: a/d conversion start request generation disabled 1: a/d conversion start request generation enabled 6? 1 ? reserved this bit is always read as 1 and cannot be modified. 5 tcieu 0 r/w underflow interrupt enable enables or disables interrupt requests (tciu) by the tcfu flag when the tcfu flag in tsr is set to 1 in channels 1, 2, 4 * , and 5 * . in channels 0 and 3 * , bit 5 is reserved. it is always read as 0 and cannot be modified. 0: interrupt requests (tciu) by tcfu disabled 1: interrupt requests (tciu) by tcfu enabled 4 tciev 0 r/w overflow interrupt enable enables or disables interrupt requests (tciv) by the tcfv flag when the tcfv flag in tsr is set to 1. 0: interrupt requests (tciv) by tcfv disabled 1: interrupt requests (tciv) by tcfv enabled 3 tgied 0 r/w tgr interrupt enable d enables or disables interrupt requests (tgid) by the tgfd bit when the tgfd bit in tsr is set to 1 in channels 0 and 3 * . in channels 1, 2, 4 * , and 5 * , bit 3 is reserved. it is always read as 0 and cannot be modified. 0: interrupt requests (tgid) by tgfd bit disabled 1: interrupt requests (tgid) by tgfd bit enabled
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 392 of 982 rej09b0054-0500 bit bit name initial value r/w description 2 tgiec 0 r/w tgr interrupt enable c enables or disables interrupt requests (tgic) by the tgfc bit when the tgfc bit in tsr is set to 1 in channels 0 and 3 * . in channels 1, 2, 4 * , and 5 * , bit 2 is reserved. it is always read as 0 and cannot be modified. 0: interrupt requests (tgic) by tgfc bit disabled 1: interrupt requests (tgic) by tgfc bit enabled 1 tgieb 0 r/w tgr interrupt enable b enables or disables interrupt requests (tgib) by the tgfb bit when the tgfb bit in tsr is set to 1. 0: interrupt requests (tgib) by tgfb bit disabled 1: interrupt requests (tgib) by tgfb bit enabled 0 tgiea 0 r/w tgr interrupt enable a enables or disables interrupt requests (tgia) by the tgfa bit when the tgfa bit in tsr is set to 1. 0: interrupt requests (tgia) by tgfa bit disabled 1: interrupt requests (tgia) by tgfa bit enabled note: * not available in the h8s/2227 group.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 393 of 982 rej09b0054-0500 11.3.5 timer status register (tsr) the tsr registers indicate the status of each channel. the tpu of the h8s/2227 group has a total of three tsr registers, one each for channels 0 to 2. in other groups, the tpu has a total of six tsr registers, one each for channels 0 to 5. bit bit name initial value r/w description 7 tcfd 1 r count direction flag status flag that shows the direction in which tcnt counts in channels 1, 2, 4 * 3 , and 5 * 3 . in channels 0 and 3 * 3 , bit 7 is reserved. it is always read as 1 and cannot be modified. 0: tcnt counts down 1: tcnt counts up 6? 1 ? reserved this bit is always read as 1 and cannot be modified. 5 tcfu 0 r/(w) * 1 underflow flag status flag that indicates that tcnt underflow has occurred when channels 1, 2, 4 * 3 , and 5 * 3 are set to phase counting mode. in channels 0 and 3 * 3 , bit 5 is reserved. it is always read as 0 and cannot be modified. [setting condition] when the tcnt value underflows (changes from h'0000 to h'ffff) [clearing condition] when 0 is written to tcfu after reading tcfu = 1 4 tcfv 0 r/(w) * 1 overflow flag status flag that indicates that tcnt overflow has occurred. [setting condition] when the tcnt value overflows (changes from h'ffff to h'0000) [clearing condition] when 0 is written to tcfv after reading tcfv = 1
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 394 of 982 rej09b0054-0500 bit bit name initial value r/w description 3tgfd 0 r/(w) * 1 input capture/output compare flag d status flag that indicates the occurrence of tgrd input capture or compare match in channels 0 and 3 * 3 . in channels 1, 2, 4 * 3 , and 5 * 3 , bit 3 is reserved. it is always read as 0 and cannot be modified. [setting conditions] ? when tcnt = tgrd while tgrd is functioning as output compare register ? when tcnt value is transferred to tgrd by input capture signal while tgrd is functioning as input capture register [clearing conditions] ? when dtc is activated by tgid interrupt while disel bit of mrb in dtc is 0 with the transfer counter not being 0 ? when 0 is written to tgfd after reading tgfd = 1 2tgfc 0 r/(w) * 1 input capture/output compare flag c status flag that indicates the occurrence of tgrc input capture or compare match in channels 0 and 3 * 3 . in channels 1, 2, 4 * 3 , and 5 * 3 , bit 2 is reserved. it is always read as 0 and cannot be modified. [setting conditions] ? when tcnt = tgrc while tgrc is functioning as output compare register ? when tcnt value is transferred to tgrc by input capture signal while tgrc is functioning as input capture register [clearing conditions] ? when dtc is activated by tgic interrupt while disel bit of mrb in dtc is 0 with the transfer counter not being 0 ? when 0 is written to tgfc after reading tgfc = 1
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 395 of 982 rej09b0054-0500 bit bit name initial value r/w description 1tgfb 0 r/(w) * 1 input capture/output compare flag b status flag that indicates the occurrence of tgrb input capture or compare match. [setting conditions] ? when tcnt = tgrb while tgrb is functioning as output compare register ? when tcnt value is transferred to tgrb by input capture signal while tgrb is functioning as input capture register [clearing conditions] ? when dtc is activated by tgib interrupt while disel bit of mrb in dtc is 0 with the transfer counter not being 0 ? when 0 is written to tgfb after reading tgfb = 1 0tgfa 0 r/(w) * 1 input capture/output compare flag a status flag that indicates the occurrence of tgra input capture or compare match. [setting conditions] ? when tcnt = tgra while tgra is functioning as output compare register ? when tcnt value is transferred to tgra by input capture signal while tgra is functioning as input capture register [clearing conditions] ? when dtc is activated by tgia interrupt while disel bit of mrb in dtc is 0 with the transfer counter not being 0 ? when dmac is activated by tgia interrupt while dte bit of dmabcr in dmac is 1 * 2 ? when 0 is written to tgfa after reading tgfa = 1 notes: 1. only 0 can be written, for flag clearing. 2. supported only by the h8s/2239 group. 3. not available in the h8s/2227 group.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 396 of 982 rej09b0054-0500 11.3.6 timer counter (tcnt) the tcnt registers are 16-bit readable/writable counters. the tpu of the h8s/2227 group has a total of three tcnt registers, one each for channels 0 to 2. in other groups, the tpu has a total of six tcnt registers, one each for channels 0 to 5. the tcnt counters are initialized to h'0000 by a reset, or in hardware standby mode. the tcnt counters cannot be accessed in 8-bit units; they must always be accessed as a 16-bit unit. 11.3.7 timer general register (tgr) the tgr registers are 16-bit readable/writable registers with a dual function as output compare and input capture registers. the tpu of the h8s/2227 group has a total of four tgr registers, two for channel 0 and one each for channels 1 and 2. in other groups, the tpu has a total of eight tgr registers, two each for channels 0 and 3, and one each for channels 1, 2, 4, and 5. tgrc and tgrd for channels 0 and 3 can also be designated for operation as buffer registers. the tgr registers cannot be accessed in 8-bit units; they must always be accessed as a 16-bit unit. tgr buffer register combinations are tgra-tgrc and tgrb-tgrd. 11.3.8 timer start register (tstr) in the h8s/2227 group, tstr selects operate/stop for channels 0 to 2. in other groups, tstr selects operate/stop for channels 0 to 5. when setting the operating mode in tmdr or setting the count clock in tcr, first stop the tcnt counter. bit bit name initial value r/w description 7, 6 ? all 0 ? reserved the write value should always be 0. 5 4 3 2 1 0 cst5 * cst4 * cst3 * cst2 cst1 cst0 0 0 0 0 0 0 r/w r/w r/w r/w r/w r/w counter start 5 to 0 these bits select operation or stoppage for tcnt. if 0 is written to the cst bit during operation with the tioc pin designated for output, the counter stops but the tioc pin output compare output level is retained. if tior is written to when the cst bit is cleared to 0, the pin output level will be changed to the set initial output value. 0: tcnt_5 to tcnt_0 count operation is stopped 1: tcnt_5 to tcnt_0 performs count operation note: * in the h8s/2227 group, bits 5 to 3 are reserved. the write value should always be 0.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 397 of 982 rej09b0054-0500 11.3.9 timer synchronous register (tsyr) in the h8s/2227 group, tsyr selects independent or synchronous tcnt operation for channels 0 to 2. in other groups, tsyr selects independent or synchronous tcnt operation for channels 0 to 5. a channel performs synchronous operation when the corresponding bit in tsyr is set to 1. bit bit name initial value r/w description 7, 6 ? all 0 r/w reserved the write value should always be 0. 5 4 3 2 1 0 sync5 * sync4 * sync3 * sync2 sync1 sync0 0 0 0 0 0 0 r/w r/w r/w r/w r/w r/w timer synchronization 5 to 0 these bits select whether operation is independent of or synchronized with other channels. when synchronous operation is selected, synchronous presetting of multiple channels, and synchronous clearing through counter clearing on another channel are possible. to set synchronous operation, the sync bits for at least two channels must be set to 1. to set synchronous clearing, in addition to the sync bit, the tcnt clearing source must also be set by means of bits cclr2 to cclr0 in tcr. 0: tcnt_5 to tcnt_0 operates independently (tcnt presetting /clearing is unrelated to other channels) 1: tcnt_5 to tcnt_0 performs synchronous operation (tcnt synchronous presetting/ synchronous clearing is possible) note: * in the h8s/2227 group, bits 5 to 3 are reserved. the write value should always be 0.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 398 of 982 rej09b0054-0500 11.4 operation 11.4.1 basic functions each channel has a tcnt and tgr register. tcnt performs up-counting, and is also capable of free-running operation, periodic counting, and external event counting. each tgr can be used as an input capture register or output compare register. counter operation: when one of bits cst2 to cst0 (h8s/2227 group) or bits cst5 to cst0 (groups other than h8s/2227) in tstr is set to 1, the tcnt counter for the corresponding channel starts counting. tcnt can operate as a free-running counter, periodic counter, and so on. 1. example of count operation setting procedure figure 11.3 shows an example of the count operation setting procedure. select counter clock operation selection select counter clearing source periodic counter set period start count [1] [2] [4] [3] [5] free-running counter start count [5] [1] [2] [3] [4] [5] select output compare register select the counter clock with bits tpsc2 to tpsc0 in tcr. at the same time, select the input clock edge with bits ckeg1 and ckeg0 in tcr. for periodic counter operation, select the tgr to be used as the tcnt clearing source with bits cclr2 to cclr0 in tcr. designate the tgr selected in [2] as an output compare register by means of tior. set the periodic counter cycle in the tgr selected in [2]. set the cst bit in tstr to 1 to start the counter operation. figure 11.3 example of counter operation setting procedure
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 399 of 982 rej09b0054-0500 2. free-running count operation and periodic count operation immediately after a reset, the tpu?s tcnt counters are all designated as free-running counters. when the relevant bit in tstr is set to 1 the corresponding tcnt counter starts up- count operation as a free-running counter. when tcnt overflows (changes from h'ffff to h'0000), the tcfv bit in tsr is set to 1. if the value of the corresponding tciev bit in tier is 1 at this point, the tpu requests an interrupt. after overflow, tcnt starts counting up again from h'0000. figure 11.4 illustrates free-running counter operation. tcnt value h'ffff h'0000 cst bit tcfv time figure 11.4 free-running counter operation when compare match is selected as the tcnt clearing source, the tcnt counter for the relevant channel performs periodic count operation. the tgr register for setting the period is designated as an output compare register, and counter clearing by compare match is selected by means of bits cclr2 to cclr0 in tcr. after the settings have been made, tcnt starts count-up operation as a periodic counter when the corresponding bit in tstr is set to 1. when the count value matches the value in tgr, the tgf bit in tsr is set to 1 and tcnt is cleared to h'0000. if the value of the corresponding tgie bit in tier is 1 at this point, the tpu requests an interrupt. after a compare match, tcnt starts counting up again from h'0000. figure 11.5 illustrates periodic counter operation.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 400 of 982 rej09b0054-0500 tcnt value tgr h'0000 cst bit tgf time counter cleared by tgr compare match flag cleared by software, dtc, or dmac * activation note: * supported only by the h8s/2239 group. figure 11.5 periodic counter operation waveform output by compare match: the tpu can perform 0, 1, or toggle output from the corresponding output pin using a compare match. 1. example of setting procedure for waveform output by compare match figure 11.6 shows an example of the setting procedure for waveform output by a compare match. select waveform output mode output selection set output timing start count [1] [2] [3] [1] select initial value 0 output or 1 output, and compare match output value 0 output, 1 output, or toggle output, by means of tior. the set initial value is output at the tioc pin until the first compare match occurs. [2] set the timing for compare match generation in tgr. [3] set the cst bit in tstr to 1 to start the count operation. figure 11.6 example of setting procedure for waveform output by compare match
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 401 of 982 rej09b0054-0500 2. examples of waveform output operation figure 11.7 shows an example of 0 output/1 output. in this example, tcnt has been designated as a free-running counter, and settings have been made so that 1 is output by compare match a, and 0 is output by compare match b. when the set level and the pin level match, the pin level does not change. tcnt value h'ffff h'0000 tioca tiocb time tgra tgrb no change no change no change no change 1 output 0 output figure 11.7 example of 0 output/1 output operation figure 11.8 shows an example of toggle output. in this example tcnt has been designated as a periodic counter (with counter clearing performed by compare match b), and settings have been made so that output is toggled by both compare match a and compare match b. tcnt value h'ffff h'0000 tiocb tioca time tgrb tgra toggle output toggle output counter cleared by tgrb compare match figure 11.8 example of toggle output operation
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 402 of 982 rej09b0054-0500 input capture function: the tcnt value can be transferred to tgr on detection of the tioc pin input edge. rising edge, falling edge, or both edges can be selected as the detection edge. for channels 0, 1, 3*, and 4*, it is also possible to specify another channel?s counter input clock or compare match signal as the input capture source. notes: when another channel?s counter input clock is used as the input capture input for channels 0 and 3, /1 should not be selected as the counter input clock used for input capture input. input capture will not be generated if /1 is selected. * not available in the h8s/2227 group. 1. example of setting procedure for input capture operation figure 11.9 shows an example of the setting procedure for input capture operation. select input capture input input selection start count [1] [2] [1] designate tgr as an input capture register by means of tior, and select the input capture source and input signal edge (rising edge, falling edge, or both edges). [2] set the cst bit in tstr to 1 to start the count operation. figure 11.9 example of setting procedure for input capture operation 2. example of input capture operation figure 11.10 shows an example of input capture operation. in this example both rising and falling edges have been selected as the tioca pin input capture input edge, falling edge has been selected as the tiocb pin input capture input edge, and counter clearing by tgrb input capture has been designated for tcnt.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 403 of 982 rej09b0054-0500 tcnt value h'0180 h'0000 tioca tgra time h'0010 h'0005 counter cleared by tiocb input (falling edge) h'0160 h'0005 h'0160 h'0010 tgrb h'0180 tiocb figure 11.10 example of input capture operation 11.4.2 synchronous operation in synchronous operation, the values in multiple tcnt counters can be rewritten simultaneously (synchronous presetting). also, multiple of tcnt counters can be cleared simultaneously (synchronous clearing) by making the appropriate setting in tcr. synchronous operation enables tgr to be incremented with respect to a single time base. channels 0 to 2 (h8s/2227 group) or 0 to 5 (groups other than h8s/2227) can all be designated for synchronous operation. example of synchronous operation setting procedure: figure 11.11 shows an example of the synchronous operation setting procedure.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 404 of 982 rej09b0054-0500 synchronous operation selection set tcnt synchronous presetting [1] [2] synchronous clearing select counter clearing source [3] start count [5] set synchronous counter clearing [4] start count [5] clearing source generation channel? no yes [1] set to 1 the sync bits in tsyr corresponding to the channels to be designated for synchronous operation. [2] when the tcnt counter of any of the channels designated for synchronous operation is written to, the same value is simultaneously written to the other tcnt counters. [3] use bits cclr2 to cclr0 in tcr to specify tcnt clearing by input capture/output compare, etc. [4] use bits cclr2 to cclr0 in tcr to designate synchronous clearing for the counter clearing source. [5] set to 1 the cst bits in tstr for the relevant channels, to start the count operation. set synchronous operation figure 11.11 example of synchronous operation setting procedure example of synchronous operation: figure 11.12 shows an example of synchronous operation. in this example, synchronous operation and pwm mode 1 have been designated for channels 0 to 2, tgrb_0 compare match has been set as the channel 0 counter clearing source, and synchronous clearing has been set for the channel 1 and 2 counter clearing source. three-phase pwm waveforms are output from pins tioca2, tioca1, and tioca0. at this time, synchronous presetting, and synchronous clearing by tgrb_0 compare match, is performed for channel 0 to 2 tcnt counters, and the data set in tgrb_0 is used as the pwm cycle.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 405 of 982 rej09b0054-0500 for details on pwm modes, see section 11.4.5, pwm modes. tcnt0 to tcnt2 values h'0000 tioca0 tioca1 tgrb_0 synchronous clearing by tgrb_0 compare match tgra_2 tgra_1 tgrb_2 tgra_0 tgrb_1 tioca2 time figure 11.12 example of synchronous operation 11.4.3 buffer operation buffer operation, provided for channels 0 and 3, enables tgrc and tgrd to be used as buffer registers. buffer operation differs depending on whether tgr has been designated as an input capture register or a compare match register. table 11.28 shows the register combinations used in buffer operation. table 11.28 register combinations in buffer operation channel timer general register buffer register 0 tgra_0 tgrc_0 tgrb_0 tgrd_0 3 * tgra_3 tgrc_3 tgrb_3 tgrd_3 note: * not available in the h8s/2227 group.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 406 of 982 rej09b0054-0500 ? when tgr is an output compare register when a compare match occurs, the value in the buffer register for the corresponding channel is transferred to the timer general register. this operation is illustrated in figure 11.13. buffer register timer general register tcnt comparator compare match signal figure 11.13 compare match buffer operation ? when tgr is an input capture register when input capture occurs, the value in tcnt is transferred to tgr and the value previously held in the timer general register is transferred to the buffer register. this operation is illustrated in figure 11.14. buffer register timer general register tcnt input capture signal figure 11.14 input capture buffer operation
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 407 of 982 rej09b0054-0500 example of buffer operation setting procedure: figure 11.15 shows an example of the buffer operation setting procedure. select tgr function buffer operation set buffer operation start count [1] [2] [3] [1] designate tgr as an input capture register or output compare register by means of tior. [2] designate tgr for buffer operation with bits bfa and bfb in tmdr. [3] set the cst bit in tstr to 1 to start the count operation. figure 11.15 example of buffer operation setting procedure examples of buffer operation: 1. when tgr is an output compare register figure 11.16 shows an operation example in which pwm mode 1 has been designated for channel 0, and buffer operation has been designated for tgra and tgrc. the settings used in this example are tcnt clearing by compare match b, 1 output at compare match a, and 0 output at compare match b. as buffer operation has been set, when compare match a occurs the output changes and the value in buffer register tgrc is simultaneously transferred to timer general register tgra. this operation is repeated each time compare match a occurs. for details on pwm modes, see section 11.4.5, pwm modes.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 408 of 982 rej09b0054-0500 tcnt value tgrb_0 h'0000 tgrc_0 tgra_0 h'0200 h'0520 tioca h'0200 h'0450 h'0520 h'0450 tgra_0 h'0450 h'0200 transfer time figure 11.16 example of buffer operation (1) 2. when tgr is an input capture register figure 11.17 shows an operation example in which tgra has been designated as an input capture register, and buffer operation has been designated for tgra and tgrc. counter clearing by tgra input capture has been set for tcnt, and both rising and falling edges have been selected as the tioca pin input capture input edge. as buffer operation has been set, when the tcnt value is stored in tgra upon occurrence of input capture a, the value previously stored in tgra is simultaneously transferred to tgrc.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 409 of 982 rej09b0054-0500 tcnt value h'09fb h'0000 tgrc time h'0532 tioca tgra h'0f07 h'0532 h'0f07 h'0532 h'0f07 h'09fb figure 11.17 example of buffer operation (2) 11.4.4 cascaded operation in cascaded operation*, two 16-bit counters for different channels are used together as a 32-bit counter. this function works by counting the channel 1 (channel 4) counter clock at overflow/underflow of tcnt_2 (tcnt_5) as set in bits tpsc2 to tpsc0 in tcr. underflow occurs only when the lower 16-bit tcnt is in phase-counting mode. table 11.29 shows the register combinations used in cascaded operation. notes: when phase counting mode is set for channel 1 or 4, the counter clock setting is invalid and the counter operates independently in phase counting mode. * not available in the h8s/2227 group. table 11.29 cascaded combinations combination upper 16 bits lower 16 bits channels 1 and 2 tcnt_1 tcnt_2 channels 4 and 5 tcnt_4 tcnt_5
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 410 of 982 rej09b0054-0500 example of cascaded operation setting procedure: figure 11.18 shows an example of the setting procedure for cascaded operation. cascaded operation set cascading start count set bits tpsc2 to tpsc0 in the channel 1 (channel 4) tcr to b'1111 to select tcnt_2 (tcnt_5) overflow/underflow counting. set the cst bit in tstr for the upper and lower channel to 1 to start the count operation. [1] [2] [1] [2] figure 11.18 cascaded operation setting procedure examples of cascaded operation: figure 11.19 illustrates the operation when counting upon tcnt_2 overflow/underflow has been set for tcnt_1, tgra_1 and tgra_2 have been designated as input capture registers, and the tioc pin rising edge has been selected. when a rising edge is input to the tioca1 and tioca2 pins simultaneously, the upper 16 bits of the 32-bit data are transferred to tgra_1, and the lower 16 bits to tgra_2. tcnt_2 clock tcnt_2 h'ffff h'0000 h'0001 tioca1, tioca2 tgra_1 h'03a2 tgra_2 h'0000 tcnt_1 clock tcnt_1 h'03a1 h'03a2 figure 11.19 example of cascaded operation (1) figure 11.20 illustrates the operation when counting upon tcnt_2 overflow/underflow has been set for tcnt_1, and phase counting mode has been designated for channel 2.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 411 of 982 rej09b0054-0500 tcnt_1 is incremented by tcnt_2 overflow and decremented by tcnt_2 underflow. tclkc tcnt_2 fffd tcnt_1 0001 tclkd fffe ffff 0000 0001 0002 0001 0000 ffff 0000 0000 figure 11.20 example of cascaded operation (2) 11.4.5 pwm modes in pwm mode, pwm waveforms are output from the output pins. 0, 1, or toggle output can be selected as the output level in response to compare match of each tgr. settings of tgr registers can output a pwm waveform in the range of 0% to 100% duty cycle. designating tgr compare match as the counter clearing source enables the cycle to be set in that register. all channels can be designated for pwm mode independently. synchronous operation is also possible. there are two pwm modes, as described below. ? pwm mode 1 pwm output is generated from the tioca and tiocc pins by pairing tgra with tgrb and tgrc with tgrd. the outputs specified by bits ioa3 to ioa0 and ioc3 to ioc0 in tior are output from the tioca and tiocc pins at compare matches a and c, respectively. the outputs specified by bits iob3 to iob0 and iod3 to iod0 in tior are output at compare matches b and d, respectively. the initial output value is the value set in tgra or tgrc. if the set values of paired tgrs are identical, the output value does not change when a compare match occurs. in pwm mode 1, a maximum 8-phase pwm output is possible. ? pwm mode 2 pwm output is generated using one tgr as the cycle register and the others as duty cycle registers. the output specified in tior is performed by means of compare matches. upon counter clearing by a synchronization register compare match, the output value of each pin is the initial value set in tior. if the set values of the cycle and duty cycle registers are identical, the output value does not change when a compare match occurs.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 412 of 982 rej09b0054-0500 in pwm mode 2, a maximum 15-phase pwm output is possible by combined use with synchronous operation. the correspondence between pwm output pins and registers is shown in table 11.30. table 11.30 pwm output registers and output pins output pins channel registers pwm mode 1 pwm mode 2 0 tgra_0 tioca0 tioca0 tgrb_0 tiocb0 tgrc_0 tiocc0 tiocc0 tgrd_0 tiocd0 1 tgra_1 tioca1 tioca1 tgrb_1 tiocb1 2 tgra_2 tioca2 tioca2 tgrb_2 tiocb2 3 * tgra_3 tioca3 tioca3 tgrb_3 tiocb3 tgrc_3 tiocc3 tiocc3 tgrd_3 tiocd3 4 * tgra_4 tioca4 tioca4 tgrb_4 tiocb4 5 * tgra_5 tioca5 tioca5 tgrb_5 tiocb5 notes: in pwm mode 2, pwm output is not possible for the tgr register in which the cycle is set. * not available in the h8s/2227 group.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 413 of 982 rej09b0054-0500 example of pwm mode setting procedure: figure 11.21 shows an example of the pwm mode setting procedure. select counter clock pwm mode select counter clearing source select waveform output level [1] [2] [3] set tgr [4] set pwm mode [5] start count [6] [1] select the counter clock with bits tpsc2 to tpsc0 in tcr. at the same time, select the input clock edge with bits ckeg1 and ckeg0 in tcr. [2] use bits cclr2 to cclr0 in tcr to select the tgr to be used as the tcnt clearing source. [3] use tior to designate the tgr as an output compare register, and select the initial value and output value. [4] set the cycle in the tgr selected in [2], and set the duty in the other tgrs. [5] select the pwm mode with bits md3 to md0 in tmdr. [6] set the cst bit in tstr to 1 to start the count operation. figure 11.21 example of pwm mode setting procedure examples of pwm mode operation: figure 11.22 shows an example of pwm mode 1 operation. in this example, tgra compare match is set as the tcnt clearing source, 0 is set for the tgra initial output value and output value, and 1 is set as the tgrb output value. in this case, the value set in tgra is used as the cycle, and the values set in tgrb registers as the duty cycle.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 414 of 982 rej09b0054-0500 tcnt value tgra h'0000 tioca time tgrb counter cleared by tgra compare match figure 11.22 example of pwm mode operation (1) figure 11.23 shows an example of pwm mode 2 operation. in this example, synchronous operation is designated for channels 0 and 1, tgrb_1 compare match is set as the tcnt clearing source, and 0 is set for the initial output value and 1 for the output value of the other tgr registers (tgra_0 to tgrd_0, tgra_1), to output a 5-phase pwm waveform. in this case, the value set in tgrb_1 is used as the cycle, and the values set in the other tgrs as the duty cycle. tcnt value tgrb_1 h'0000 tioca0 counter cleared by tgrb_1 compare match time tgra_1 tgrd_0 tgrc_0 tgrb_0 tgra_0 tiocb0 tiocc0 tiocd0 tioca1 figure 11.23 example of pwm mode operation (2)
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 415 of 982 rej09b0054-0500 figure 11.24 shows examples of pwm waveform output with 0% duty cycle and 100% duty cycle in pwm mode. tcnt value tgra h'0000 tioca time tgrb 0% duty tgrb rewritten tgrb rewritten tgrb rewritten tcnt value tgra h'0000 tioca time tgrb 100% duty tgrb rewritten tgrb rewritten tgrb rewritten output does not change when cycle register and duty register compare matches occur simultaneously tcnt value tgra h'0000 tioca time tgrb 100% duty tgrb rewritten tgrb rewritten tgrb rewritten output does not change when cycle register and duty register compare matches occur simultaneously 0% duty figure 11.24 example of pwm mode operation (3)
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 416 of 982 rej09b0054-0500 11.4.6 phase counting mode in phase counting mode, the phase difference between two external clock inputs is detected and tcnt is incremented/decremented accordingly. in the h8s/2227 group, this mode can be set for channels 1 and 2. in other groups, it can be set for channels 1, 2, 4, and 5. when phase counting mode is set, an external clock is selected as the counter input clock and tcnt operates as an up/down-counter regardless of the setting of bits tpsc2 to tpsc0 and bits ckeg1 and ckeg0 in tcr. however, the functions of bits cclr1 and cclr0 in tcr, and of tior, tier, and tgr are valid, and input capture/compare match and interrupt functions can be used. this can be used for two-phase encoder pulse input. when overflow occurs while tcnt is counting up, the tcfv flag in tsr is set; when underflow occurs while tcnt is counting down, the tcfu flag is set. the tcfd bit in tsr is the count direction flag. reading the tcfd flag provides an indication of whether tcnt is counting up or down. table 11.31 shows the correspondence between external clock pins and channels. table 11.31 clock input pins in phase counting mode external clock pins channels a-phase b-phase when channel 1 or 5 * is set to phase counting mode tclka tclkb when channel 2 or 4 * is set to phase counting mode tclkc tclkd note: * not available in the h8s/2227 group.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 417 of 982 rej09b0054-0500 example of phase counting mode setting procedure: figure 11.25 shows an example of the phase counting mode setting procedure. phase counting mode select phase counting mode start count select phase counting mode with bits md3 to md0 in tmdr. set the cst bit in tstr to 1 to start the count operation. [1] [2] [1] [2] figure 11.25 example of phase counting mode setting procedure examples of phase counting mode operation: in phase counting mode, tcnt counts up or down according to the phase difference between two external clocks. there are four modes, according to the count conditions. 1. phase counting mode 1 figure 11.26 shows an example of phase counting mode 1 operation, and table 11.32 summarizes the tcnt up/down-count conditions. tcnt value time down-count up-count tclka (channels 1 and 5 * ) tclkc (channels 2 and 4 * ) tclkb (channels 1 and 5 * ) tclkd (channels 2 and 4 * ) note: * not available in the h8s/2227 group. figure 11.26 example of phase counting mode 1 operation
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 418 of 982 rej09b0054-0500 table 11.32 up/down-count conditions in phase counting mode 1 tclka (channels 1 and 5 * ) tclkc (channels 2 and 4 * ) tclkb (channels 1 and 5 * ) tclkd (channels 2 and 4 * ) operation high level up-count low level low level high level high level down-count low level high level low level legend: : rising edge : falling edge note: * not available in the h8s/2227 group.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 419 of 982 rej09b0054-0500 2. phase counting mode 2 figure 11.27 shows an example of phase counting mode 2 operation, and table 11.33 summarizes the tcnt up/down-count conditions. time down-count up-count tcnt value tclka (channels 1 and 5 * ) tclkc (channels 2 and 4 * ) tclkb (channels 1 and 5 * ) tclkd (channels 2 and 4 * ) note: * not available in the h8s/2227 group. figure 11.27 example of phase counting mode 2 operation table 11.33 up/down-count conditions in phase counting mode 2 tclka (channels 1 and 5 * ) tclkc (channels 2 and 4 * ) tclkb (channels 1 and 5 * ) tclkd (channels 2 and 4 * ) operation high level don?t care low level low level high level up-count high level don?t care low level high level low level down-count legend: : rising edge : falling edge note: * not available in the h8s/2227 group.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 420 of 982 rej09b0054-0500 3. phase counting mode 3 figure 11.28 shows an example of phase counting mode 3 operation, and table 11.34 summarizes the tcnt up/down-count conditions. time up-count down-count tcnt value tclka (channels 1 and 5 * ) tclkc (channels 2 and 4 * ) tclkb (channels 1 and 5 * ) tclkd (channels 2 and 4 * ) note: * not available in the h8s/2227 group. figure 11.28 example of phase counting mode 3 operation table 11.34 up/down-count conditions in phase counting mode 3 tclka (channels 1 and 5 * ) tclkc (channels 2 and 4 * ) tclkb (channels 1 and 5 * ) tclkd (channels 2 and 4 * ) operation high level don?t care low level low level high level up-count high level down-count low level don?t care high level low level legend: : rising edge : falling edge note: * not available in the h8s/2227 group.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 421 of 982 rej09b0054-0500 4. phase counting mode 4 figure 11.29 shows an example of phase counting mode 4 operation, and table 11.35 summarizes the tcnt up/down-count conditions. time up-count down-count tcnt value tclka (channels 1 and 5 * ) tclkc (channels 2 and 4 * ) tclkb (channels 1 and 5 * ) tclkd (channels 2 and 4 * ) note: * not available in the h8s/2227 group. figure 11.29 example of phase counting mode 4 operation table 11.35 up/down-count conditions in phase counting mode 4 tclka (channels 1 and 5 * ) tclkc (channels 2 and 4 * ) tclkb (channels 1 and 5 * ) tclkd (channels 2 and 4 * ) operation high level up-count low level low level don?t care high level high level down-count low level high level don?t care low level legend: : rising edge : falling edge note: * not available in the h8s/2227 group.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 422 of 982 rej09b0054-0500 phase counting mode application example: figure 11.30 shows an example in which phase counting mode is designated for channel 1, and channel 1 is coupled with channel 0 to input servo motor 2-phase encoder pulses in order to detect the position or speed. channel 1 is set to phase counting mode 1, and the encoder pulse a-phase and b-phase are input to tclka and tclkb. channel 0 operates with tcnt counter clearing by tgrc_0 compare match; tgra_0 and tgrc_0 are used for the compare match function, and are set with the speed control cycle and position control cycle. tgrb_0 is used for input capture, with tgrb_0 and tgrd_0 operating in buffer mode. the channel 1 counter input clock is designated as the tgrb_0 input capture source, and detection of the pulse width of 2-phase encoder 4-multiplication pulses is performed. tgra_1 and tgrb_1 for channel 1 are designated for input capture, channel 0 tgra_0 and tgrc_0 compare matches are selected as the input capture source, and the up/down-counter values for the control cycles are stored. this procedure enables accurate position/speed detection to be achieved. tcnt_1 tcnt_0 channel 1 tgra_1 (speed cycle capture) tgra_0 (speed control cycle) tgrb_1 (position cycle capture) tgrc_0 (position control cycle) tgrb_0 (pulse width capture) tgrd_0 (buffer operation) channel 0 tclka tclkb edge detection circuit + - + - figure 11.30 phase counting mode application example
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 423 of 982 rej09b0054-0500 11.5 interrupt sources there are three kinds of tpu interrupt source: tgr input capture/compare match, tcnt overflow, and tcnt underflow. each interrupt source has its own status flag and enable/disable bit, allowing generation of interrupt request signals to be enabled or disabled individually. when an interrupt request is generated, the corresponding status flag in tsr is set to 1. if the corresponding enable/disable bit in tier is set to 1 at this time, an interrupt is requested. the interrupt request is cleared by clearing the status flag to 0. relative channel priorities can be changed by the interrupt controller, but the priority order within a channel is fixed. for details, see section 5, interrupt controller. table 11.36 lists the tpu interrupt sources.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 424 of 982 rej09b0054-0500 table 11.36 tpu interrupts channel name interrupt source interrupt flag dtc activation dmac activation * 1 0 tgi0a tgra_0 input capture/compare match tgfa_0 possible possible tgi0b tgrb_0 input capture/compare match tgfb_0 possible not possible tgi0c tgrc_0 input capture/compare match tgfc_0 possible not possible tgi0d tgrd_0 input capture/compare match tgfd_0 possible not possible tgi0v tcnt_0 overflow tcfv_0 not possible not possible 1 tgi1a tgra_1 input capture/compare match tgfa_1 possible possible tgi1b tgrb_1 input capture/compare match tgfb_1 possible not possible tci1v tcnt_1 overflow tcfv_1 not possible not possible tci1u tcnt_1 underflow tcfu_1 not possible not possible 2 tgi2a tgra_2 input capture/compare match tgfa_2 possible possible tgi2b tgrb_2 input capture/compare match tgfb_2 possible not possible tci2v tcnt_2 overflow tcfv_2 not possible not possible tci2u tcnt_2 underflow tcfu_2 not possible not possible 3 * 2 tgi3a tgra_3 input capture/compare match tgfa_3 possible possible tgi3b tgrb_3 input capture/compare match tgfb_3 possible not possible tgi3c tgrc_3 input capture/compare match tgfc_3 possible not possible tgi3d tgrd_3 input capture/compare match tgfd_3 possible not possible tci3v tcnt_3 overflow tcfv_3 not possible not possible 4 * 2 tgi4a tgra_4 input capture/compare match tgfa_4 possible possible tgi4b tgrb_4 input capture/compare match tgfb_4 possible not possible tci4v tcnt_4 overflow tcfv_4 not possible not possible tci4u tcnt_4 underflow tcfu_4 not possible not possible 5 * 2 tgi5a tgra_5 input capture/compare match tgfa_5 possible possible tgi5b tgrb_5 input capture/compare match tgfb_5 possible not possible tci5v tcnt_5 overflow tcfv_5 not possible not possible tci5u tcnt_5 underflow tcfu_5 not possible not possible notes: this table shows the initial state immediately after a reset. the relative channel priorities can be changed by the interrupt controller. 1. supported only by the h8s/2239 group. 2. not available in the h8s/2227 group.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 425 of 982 rej09b0054-0500 input capture/compare match interrupt: an interrupt is requested if the tgie bit in tier is set to 1 when the tgf flag in tsr is set to 1 by the occurrence of a tgr input capture/compare match on a particular channel. the interrupt request is cleared by clearing the tgf flag to 0. in the h8s/2227 group, the tpu has eight input capture/compare match interrupts, four for channel 0 and two each for channels 1 and 2. in other groups, the tpu has 16 input capture/compare match interrupts, four each for channels 0 and 3, and two each for channels 1, 2, 4, and 5. overflow interrupt: an interrupt is requested if the tciev bit in tier is set to 1 when the tcfv flag in tsr is set to 1 by the occurrence of tcnt overflow on a channel. the interrupt request is cleared by clearing the tcfv flag to 0. in the h8s/2227 group, the tpu has three overflow interrupts, one each for channels 0 to 2. in other groups, the tpu has six overflow interrupts, one each for channels 0 to 5. underflow interrupt: an interrupt is requested if the tcieu bit in tier is set to 1 when the tcfu flag in tsr is set to 1 by the occurrence of tcnt underflow on a channel. the interrupt request is cleared by clearing the tcfu flag to 0. the tpu of the h8s/2227 group has two underflow interrupts, one each for channels 1 and 2. in other groups, the tpu has four underflow interrupts, one each for channels 1, 2, 4, and 5. 11.6 dtc activation the dtc can be activated by the tgr input capture/compare match interrupt for a channel. for details, see section 9, data transfer controller (dtc). in the h8s/2227 group, a total of eight tpu input capture/compare match interrupts can be used as dtc activation sources, four for channel 0 and two each for channels 1 and 2. in other groups, a total of 16 tpu input capture/compare match interrupts can be used as dtc activation sources, four each for channels 0 and 3, and two each for channels 1, 2, 4, and 5. 11.7 dmac activation (h8s/2239 group only) the dmac can be activated by the tgra input capture/compare match interrupt for a channel. for details, see section 8, dma controller (dmac). in the tpu, a total of six tgra input capture/compare match interrupts can be used as dmac activation sources, one for each channel.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 426 of 982 rej09b0054-0500 11.8 a/d converter activation the a/d converter can be activated by the tgra input capture/compare match for a channel. if the ttge bit in tier is set to 1 when the tgfa flag in tsr is set to 1 by the occurrence of a tgra input capture/compare match on a particular channel, a request to start a/d conversion is sent to the a/d converter. if the tpu conversion start trigger has been selected on the a/d converter side at this time, a/d conversion is started. in the tpu, a total of six tgra input capture/compare match interrupts can be used as a/d converter conversion start sources, one for each channel. 11.9 operation timing 11.9.1 input/output timing tcnt count timing: figure 11.31 shows tcnt count timing in internal clock operation, and figure 11.32 shows tcnt count timing in external clock operation. tcnt tcnt input clock internal clock n ? 1 n n + 1 n + 2 falling edge rising edge figure 11.31 count timing in internal clock operation
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 427 of 982 rej09b0054-0500 tcnt tcnt input clock external clock n ? 1 n n + 1 n + 2 falling edge rising edge falling edge figure 11.32 count timing in external clock operation output compare output timing: a compare match signal is generated in the final state in which tcnt and tgr match (the point at which the count value matched by tcnt is updated). when a compare match signal is generated, the output value set in tior is output at the output compare output pin. after a match between tcnt and tgr, the compare match signal is not generated until the (tioc pin) tcnt input clock is generated. figure 11.33 shows output compare output timing. tgr tcnt tcnt input clock n n n + 1 compare match signal tioc pin figure 11.33 output compare output timing
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 428 of 982 rej09b0054-0500 input capture signal timing: figure 11.34 shows input capture signal timing. tcnt input capture input n n + 1 n + 2 n n + 2 tgr input capture signal figure 11.34 input capture input signal timing timing for counter clearing by compare match/input capture: figure 11.35 shows the timing when counter clearing by compare match occurrence is specified, and figure 11.36 shows the timing when counter clearing by input capture occurrence is specified. tcnt counter clear signal compare match signal tgr n n h'0000 figure 11.35 counter clear timing (compare match)
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 429 of 982 rej09b0054-0500 tcnt counter clear signal input capture signal tgr n h'0000 n figure 11.36 counter clear timing (input capture) buffer operation timing: figures 11.37 and 11.38 show the timings in buffer operation. tgra, tgrb compare match signal tcnt tgrc, tgrd nn n n n + 1 figure 11.37 buffer operation timing (compare match)
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 430 of 982 rej09b0054-0500 tgra, tgrb tcnt input capture signal tgrc, tgrd n n n n + 1 n n n + 1 figure 11.38 buffer operation timing (input capture) 11.9.2 interrupt signal timing tgf flag setting timing in case of compare match: figure 11.39 shows the timing for setting of the tgf flag in tsr by compare match occurrence, and the tgi interrupt request signal timing. tgr tcnt tcnt input clock n n n + 1 compare match signal tgf flag tgi interrupt figure 11.39 tgi interrupt timing (compare match)
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 431 of 982 rej09b0054-0500 tgf flag setting timing in case of input capture: figure 11.40 shows the timing for setting of the tgf flag in tsr by input capture occurrence, and the tgi interrupt request signal timing. tgr tcnt input capture signal n n tgf flag tgi interrupt figure 11.40 tgi interrupt timing (input capture) tcfv flag/tcfu flag setting timing: figure 11.41 shows the timing for setting of the tcfv flag in tsr by overflow occurrence, and the tciv interrupt request signal timing. figure 11.42 shows the timing for setting of the tcfu flag in tsr by underflow occurrence, and the tciu interrupt request signal timing. overflow signal tcnt (overflow) tcnt input clock h'ffff h'0000 tcfv flag tciv interrupt figure 11.41 tciv interrupt setting timing
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 432 of 982 rej09b0054-0500 underflow signal tcnt (underflow) tcnt input clock h'0000 h'ffff tcfu flag tciu interrupt figure 11.42 tciu interrupt setting timing status flag clearing timing: after a status flag is read as 1 by the cpu, it is cleared by writing 0 to it. when the dtc or dmac* is activated, the flag is cleared automatically. figure 11.43 shows the timing for status flag clearing by the cpu, and figure 11.44 shows the timing for status flag clearing by the dtc or dmac*. note: * supported only by the h8s/2239 group. status flag write signal address tsr address interrupt request signal tsr write cycle t 1 t 2 figure 11.43 timing for status flag clearing by cpu
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 433 of 982 rej09b0054-0500 interrupt request signal status flag address source address dtc/dmac * read cycle t 1 t 2 destination address t 1 t 2 dtc/dmac * write cycle note: * supported only by the h8s/2239 group. figure 11.44 timing for status flag clearing by dtc/dmac * activation note: * supported only by the h8s/2239 group. 11.10 usage notes 11.10.1 module stop mode setting tpu operation can be disabled or enabled using the module stop control register. the initial setting is for tpu operation to be halted. register access is enabled by clearing module stop mode. for details, refer to section 24, power-down modes. 11.10.2 input clock restrictions the input clock pulse width must be at least 1.5 states in the case of single-edge detection, and at least 2.5 states in the case of both-edge detection. the tpu will not operate properly with a narrower pulse width. in phase counting mode, the phase difference and overlap between the two input clocks must be at least 1.5 states, and the pulse width must be at least 2.5 states. figure 11.45 shows the input clock conditions in phase counting mode.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 434 of 982 rej09b0054-0500 overlap phase diffe- rence phase diffe- rence overlap tclka (tclkc) tclkb (tclkd) pulse width pulse width pulse width pulse width notes: phase difference and overlap: pulse width: 1.5 states or more 2.5 states or more figure 11.45 phase difference, overlap, and pulse width in phase counting mode 11.10.3 caution on cycle setting when counter clearing by compare match is set, tcnt is cleared in the final state in which it matches the tgr value (the point at which the count value matched by tcnt is updated). consequently, the actual counter frequency is given by the following formula: f = (n + 1) where f: counter frequency : operating frequency n: tgr set value 11.10.4 contention between tcnt write and clear operations if the counter clearing signal is generated in the t 2 state of a tcnt write cycle, tcnt clearing takes precedence and the tcnt write is not performed. figure 11.46 shows the timing in this case.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 435 of 982 rej09b0054-0500 counter clearing signal write signal address tcnt address tcnt tcnt write cycle t 1 t 2 n h'0000 figure 11.46 contention between tcnt write and clear operations 11.10.5 contention between tcnt write and increment operations if incrementing occurs in the t 2 state of a tcnt write cycle, the tcnt write takes precedence and tcnt is not incremented. figure 11.47 shows the timing in this case. tcnt input clock write signal address tcnt address tcnt tcnt write cycle t 1 t 2 n m tcnt write data figure 11.47 contention between tcnt write and increment operations
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 436 of 982 rej09b0054-0500 11.10.6 contention between tgr write and compare match if a compare match occurs in the t 2 state of a tgr write cycle, the tgr write takes precedence and the compare match signal is disabled. a compare match also does not occur when the same value as before is written. figure 11.48 shows the timing in this case. compare match signal write signal address tgr address tcnt tgr write cycle t 1 t 2 n m tgr write data tgr n n + 1 prohibited figure 11.48 contention between tgr write and compare match 11.10.7 contention between buffer register write and compare match if a compare match occurs in the t 2 state of a tgr write cycle, the data transferred to tgr by the buffer operation will be the data prior to the write. figure 11.49 shows the timing in this case.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 437 of 982 rej09b0054-0500 compare match signal write signal address buffer register address buffer register tgr write cycle t 1 t 2 n tgr n m buffer register write data figure 11.49 contention between buffer register write and compare match 11.10.8 contention between tgr read and input capture if the input capture signal is generated in the t 1 state of a tgr read cycle, the data that is read will be the data after input capture transfer. figure 11.50 shows the timing in this case. input capture signal read signal address tgr address tgr tgr read cycle t 1 t 2 m internal data bus x m figure 11.50 contention between tgr read and input capture
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 438 of 982 rej09b0054-0500 11.10.9 contention between tgr write and input capture if the input capture signal is generated in the t 2 state of a tgr write cycle, the input capture operation takes precedence and the write to tgr is not performed. figure 11.51 shows the timing in this case. input capture signal write signal address tcnt tgr write cycle t 1 t 2 m tgr m tgr address figure 11.51 contention between tgr write and input capture 11.10.10 contention between buffer register write and input capture if the input capture signal is generated in the t 2 state of a buffer register write cycle, the buffer operation takes precedence and the write to the buffer register is not performed. figure 11.52 shows the timing in this case.
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 439 of 982 rej09b0054-0500 input capture signal write signal address tcnt buffer register write cycle t 1 t 2 n tgr n m m buffer register buffer register address figure 11.52 contention between buffer register write and input capture 11.10.11 contention between overflow/underflow and counter clearing if overflow/underflow and counter clearing occur simultaneously, the tcfv/tcfu flag in tsr is not set and tcnt clearing takes precedence. figure 11.53 shows the operation timing when a tgr compare match is specified as the clearing source, and h'ffff is set in tgr. counter clearing signal tcnt input clock tcnt tgf flag prohibited tcfv flag h'ffff h'0000 figure 11.53 contention between overflow and counter clearing
section 11 16-bit timer pulse unit (tpu) rev. 5.00 aug 08, 2006 page 440 of 982 rej09b0054-0500 11.10.12 contention between tcnt write and overflow/underflow if there is an up-count or down-count in the t 2 state of a tcnt write cycle, when overflow/underflow occurs, the tcnt write takes precedence and the tcfv/tcfu flag in tsr is not set. figure 11.54 shows the operation timing when there is contention between tcnt write and overflow. write signal address tcnt address tcnt tcnt write cycle t 1 t 2 h'ffff m tcnt write data tcfv flag prohibited figure 11.54 contention between tcnt write and overflow 11.10.13 multiplexing of i/o pins in this lsi, the tclka input pin is multiplexed with the tiocc0 i/o pin, the tclkb input pin with the tiocd0 i/o pin, the tclkc input pin with the tiocb1 i/o pin, and the tclkd input pin with the tiocb2 i/o pin. when an external clock is input, compare match output should not be performed from a multiplexed pin. 11.10.14 interrupts and module stop mode if module stop mode is entered when an interrupt has been requested, it will not be possible to clear the cpu interrupt source or the dmac* or dtc activation source. interrupts should therefore be disabled before entering module stop mode. note: * supported only by the h8s/2239 group.
section 12 8-bit timers rev. 5.00 aug 08, 2006 page 441 of 982 rej09b0054-0500 section 12 8-bit timers the h8s/2258 group, h8s/2239 group, and h8s/2238 group have an on-chip 8-bit timer module with four channels (tmr_0, tmr_1, tmr_2, and tmr_3) operating on the basis of an 8-bit counter. the h8s/2237 group and h8s/2227 group have an on-chip 8-bit timer module with two channels (tmr_0 and tmr_1) operating on the basis of an 8-bit counter. the 8-bit timer module can be used to count external events and be used as a multifunction timer in a variety of applications, such as generation of counter reset, interrupt requests, and pulse output with an arbitrary duty cycle using a compare-match signal with two registers. 12.1 features ? selection of clock sources selected from three internal clocks ( /8, /64, and /8192) and an external clock. ? selection of three ways to clear the counters the counters can be cleared on compare-match a or b, or by an external reset signal. ? timer output controlled by two compare-match signals the timer output signal in each channel is controlled by two independent compare-match signals, enabling the timer to be used for various applications, such as the generation of pulse output or pwm output with an arbitrary duty cycle. ? cascading of the two channels ? tmr_0 and tmr_1 cascading the module can operate as a 16-bit timer using tmr_0 as the upper half and channel tmr_1 as the lower half (16-bit count mode). tmr_1 can be used to count tmr_0 compare-match occurrences (compare-match count mode). ? tmr_2* and tmr_3* cascading the module can operate as a 16-bit timer using tmr_2 as the upper half and channel tmr_3 as the lower half (16-bit count mode). tmr_3 can be used to count tmr_2 compare-match occurrences (compare-match count mode). ? multiple interrupt sources for each channel two compare-match interrupts and one overflow interrupt can be requested independently. ? generation of a/d conversion start trigger channel 0 compare-match signal can be used as the a/d conversion start trigger.
section 12 8-bit timers rev. 5.00 aug 08, 2006 page 442 of 982 rej09b0054-0500 ? module stop mode can be set at initialization, the 8-bit timer operation is halted. register access is enabled by canceling the module stop mode. note: * not available in the h8s/2237 group and h8s/2227 group. figure 12.1 shows a block diagram of the 8-bit timer module (tmr_0 and tmr_1). external clock sources internal clock * sources /8 /64 /8192 clock 1 clock 0 compare-match a1 compare-match a0 clear 1 cmia0 cmib0 ovi0 cmia1 cmib1 ovi1 interrupt signals tmo tmri01 internal bus tcora_0 comparator a_0 comparator b_0 tcorb_0 tcsr_0 tcr_0 tcora_1 comparator a_1 tcnt_1 comparator b_1 tcorb_1 tcsr_1 tcr_1 tmci01 tcnt_0 overflow 1 overflow 0 compare-match b1 compare-match b0 tmo1 a/d conversion start request signal clock select control logic clear 0 legend: note: * when a sub-clock is operating in power-down mode, will be f sub . time constant register a_0 time constant register b_0 timer counter _0 timer control/status register _0 timer control register _0 tcora_0: tcorb_0: tcnt_0: tcsr_0: tcr_0: time constant register a_1 time constant register b_1 timer counter _1 timer control/status register _1 timer control register _1 tcora_1: tcorb_1: tcnt_1: tcsr_1: tcr_1: figure 12.1 block diagram of 8-bit timer module
section 12 8-bit timers rev. 5.00 aug 08, 2006 page 443 of 982 rej09b0054-0500 12.2 input/output pins table 12.1 summarizes the input and output pins of the 8-bit timer module. table 12.1 pin configuration channel name symbol i/o function 0 timer output tmo0 output output controlled by compare-match 1 timer output tmo1 output output controlled by compare-match timer clock input tmci01 input external clock input for the counter common to 0 and 1 timer reset input tmri01 input external reset input for the counter 2 timer output tmo2 * output output controlled by compare-match 3 timer output tmo3 * output output controlled by compare-match timer clock input tmci23 * input external clock input for the counter common to 2 and 3 timer reset input tmri23 * input external reset input for the counter note: * not available in the h8s/2237 group and h8s/2227 group. 12.3 register descriptions the 8-bit timer has the following registers. for details on the module stop register, refer to section 24.1.2, module stop registers a to c (mstpcra to mstpcrc). ? time constant register a_0 (tcora_0) ? time constant register b_0 (tcorb_0) ? timer control register_0 (tcr_0) ? timer control/status register_0 (tcsr_0) ? timer counter_1 (tcnt_1) ? time constant register a_1 (tcora_1) ? time constant register b_1 (tcorb_1) ? timer control register_1 (tcr_1) ? timer control/status register_1 (tcsr_1) ? timer counter_2 (tcnt_2)* ? time constant register a_2 (tcora_2)* ? time constant register b_2 (tcorb_2)* ? timer control register_2 (tcr_2)* ? timer control/status register_2 (tcsr_2)* ? timer counter_3 (tcnt_3)*
section 12 8-bit timers rev. 5.00 aug 08, 2006 page 444 of 982 rej09b0054-0500 ? time constant register a_3 (tcora_3)* ? time constant register b_3 (tcorb_3)* ? timer control register_3 (tcr_3)* ? timer control/status register_3 (tcsr_3)* note: * not available in the h8s/2237 group and h8s/2227 group. 12.3.1 timer counter (tcnt) each tcnt is an 8-bit up-counter. tcnt_0 and tcnt_1 (tcnt_2 and tcnt_3)* comprise a single 16-bit register, so they can be accessed together by word access. tcnt increments on pulses generated from an internal or external clock source. this clock source is selected by clock select bits cks2 to cks0 in tcr. tcnt can be cleared by an external reset input signal or compare-match signals a and b. counter clear bits cclr1 and cclr0 in tcr select the method of clearing. when tcnt overflows from h'ff to h'00, the overflow flag (ovf) in tcsr is set to 1. the initial value of tcnt is h'00. note: * not available in the h8s/2237 group and h8s/2227 group. 12.3.2 time constant register a (tcora) tcora is an 8-bit readable/writable register. tcora_0 and tcora_1 (tcora_2 and tcora_3)* comprise a single 16-bit register, so they can be accessed together by word access. tcora is continually compared with the value in tcnt. when a match is detected, the corresponding compare-match flag a (cmfa) in tcsr is set. note, however, that comparison is disabled during the t2 state of a tcora write cycle. the timer output from the tmo pin can be freely controlled by the compare-match signal a and the settings of output select bits os1 and os0 in tcsr. the initial value of tcora is h'ff. note: * not available in the h8s/2237 group and h8s/2227 group.
section 12 8-bit timers rev. 5.00 aug 08, 2006 page 445 of 982 rej09b0054-0500 12.3.3 time constant register b (tcorb) tcorb is an 8-bit readable/writable register. tcorb_0 and tcorb_1 (tcorb_2 and tcorb_3)* comprise a single 16-bit register, so they can be accessed together by word access. tcorb is continually compared with the value in tcnt. when a match is detected, the corresponding compare-match flag b (cmfb) in tcsr is set. note, however, that comparison is disabled during the t2 state of a tcorb write cycle. the timer output from the tmo pin can be freely controlled by the compare-match signal b and the settings of output select bits os1 and os0 in tcsr. the initial value of tcorb is h'ff. note: * not available in the h8s/2237 group and h8s/2227 group. 12.3.4 timer control register (tcr) tcr selects the tcnt clock source and the time at which tcnt is cleared, and controls interrupt requests. bit bit name initial value r/w description 7 cmieb 0 r/w compare-match interrupt enable b selects whether the cmfb interrupt request (cmib) is enabled or disabled when the cmfb flag in tcsr is set to 1. 0: cmfb interrupt request (cmib) is disabled 1: cmfb interrupt request (cmib) is enabled 6 cmiea 0 r/w compare-match interrupt enable a selects whether the cmfa interrupt request (cmia) is enabled or disabled when the cmfa flag in tcsr is set to 1. 0: cmfa interrupt request (cmia) is disabled 1: cmfa interrupt request (cmia) is enabled 5 ovie 0 r/w timer overflow interrupt enable selects whether the ovf interrupt request (ovi) is enabled or disabled when the ovf flag in tcsr is set to 1. 0: ovf interrupt request (ovi) is disabled 1: ovf interrupt request (ovi) is enabled
section 12 8-bit timers rev. 5.00 aug 08, 2006 page 446 of 982 rej09b0054-0500 bit bit name initial value r/w description 4 3 cclr1 cclr0 0 0 r/w r/w counter clear 1 and 0 these bits select the method by which tcnt is cleared. 00: clearing is disabled 01: cleared on compare-match a 10: cleared on compare-match b 11: cleared on rising edge of external reset input 2 1 0 cks2 cks1 cks0 0 0 0 r/w r/w r/w clock select 2 to 0 the input clock can be selected from three clocks divided from the system clock ( ). when use of an external clock is selected, three types of count can be selected: at the rising edge, the falling edge, and both rising and falling edges. 000: clock input disabled 001: /8 internal clock source, counted on the falling edge 010: /64 internal clock source, counted on the falling edge 011: /8192 internal clock source, counted on the falling edge 100: for channel 0: counted on tcnt1 overflow signal * 1 for channel 1: counted on tcnt0 compare-match a * 1 for channel 2: * 2 counted on tcnt3 overflow signal * 1 for channel 3: * 2 counted on tcnt2 compare-match a * 1 101: external clock source, counted at rising edge 110: external clock source, counted at falling edge 111: external clock source, counted at both rising and falling edges notes: 1. if the count input of channel 0 (channel 2) is the tcnt1 (tcnt3) overflow signal and that of channel 1 (channel 3) is the tcnt1 (tcnt3) compare-match signal, no incrementing clock will be generated. do not use this setting. 2. not available in the h8s/2237 group and h8s/2227 group.
section 12 8-bit timers rev. 5.00 aug 08, 2006 page 447 of 982 rej09b0054-0500 12.3.5 timer control/status register (tcsr) tcsr indicates status flags and controls compare-match output. ? tcsr_0 bit bit name initial value r/w description 7cmfb 0 r/(w) * compare-match flag b [setting condition] when tcnt = tcorb [clearing conditions] ? read cmfb when cmfb = 1, then write 0 in cmfb ? when dtc is activated by cmib interrupt while disel bit of mrb in dtc is 0 with the transfer counter not being 0 6cmfa 0 r/(w) * compare-match flag a [setting condition] when tcnt = tcora [clearing conditions] ? read cmfa when cmfa = 1, then write 0 in cmfa ? when dtc is activated by cmia interrupt while disel bit of mrb in dtc is 0 with the transfer counter not being 0 5ovf 0 r/(w) * timer overflow flag [setting condition] when tcnt overflows from h'ff to h'00 [clearing condition] read ovf when ovf = 1, then write 0 in ovf 4 adte 0 r/w a/d trigger enable enables or disables a/d converter start requests by compare-match a. 0: a/d converter start requests by compare-match a are disabled 1: a/d converter start requests by compare-match a are enabled
section 12 8-bit timers rev. 5.00 aug 08, 2006 page 448 of 982 rej09b0054-0500 bit bit name initial value r/w description 3 2 os3 os2 0 0 r/w r/w output select 3 and 2 these bits specify how the timer output level is to be changed by a compare-match b of tcorb and tcnt. 00: no change when compare-match b occurs 01: 0 is output when compare-match b occurs 10: 1 is output when compare-match b occurs 11: output is inverted when compare-match b occurs (toggle output) 1 0 os1 os0 0 0 r/w r/w output select 1 and 0 these bits specify how the timer output level is to be changed by a compare-match a of tcora and tcnt. 00: no change when compare-match a occurs 01: 0 is output when compare-match a occurs 10: 1 is output when compare-match a occurs 11: output is inverted when compare-match a occurs (toggle output) note: * only 0 can be written to this bit, to clear the flag.
section 12 8-bit timers rev. 5.00 aug 08, 2006 page 449 of 982 rej09b0054-0500 ? tcsr_1 and tcsr_3 * 1 bit bit name initial value r/w description 7cmfb 0 r/(w) * 2 compare-match flag b [setting condition] when tcnt = tcorb [clearing conditions] ? read cmfb when cmfb = 1, then write 0 in cmfb ? when dtc is activated by cmib interrupt while disel bit of mrb in dtc is 0 with the transfer counter not being 0 6cmfa 0 r/(w) * 2 compare-match flag a [setting condition] when tcnt = tcora [clearing conditions] ? read cmfa when cmfa = 1, then write 0 in cmfa ? when dtc is activated by cmia interrupt while disel bit of mrb in dtc is 0 with the transfer counter not being 0 5ovf 0 r/(w) * 2 timer overflow flag [setting condition] when tcnt overflows from h'ff to h'00 [clearing condition] read ovf when ovf = 1, then write 0 in ovf 4 ? 1 ? reserved this bit is always read as 1 and cannot be modified.
section 12 8-bit timers rev. 5.00 aug 08, 2006 page 450 of 982 rej09b0054-0500 bit bit name initial value r/w description 3 2 os3 os2 0 0 r/w r/w output select 3 and 2 these bits specify how the timer output level is to be changed by a compare-match b of tcorb and tcnt. 00: no change when compare-match b occurs 01: 0 is output when compare-match b occurs 10: 1 is output when compare-match b occurs 11: output is inverted when compare-match b occurs (toggle output) 1 0 os1 os0 0 0 r/w r/w output select 1 and 0 these bits specify how the timer output level is to be changed by a compare-match a of tcora and tcnt. 00: no change when compare-match a occurs 01: 0 is output when compare-match a occurs 10: 1 is output when compare-match a occurs 11: output is inverted when compare-match a occurs (toggle output) notes: 1. not available in the h8s/2237 group and h8s/2227 group. 2. only 0 can be written to this bit, to clear the flag.
section 12 8-bit timers rev. 5.00 aug 08, 2006 page 451 of 982 rej09b0054-0500 ? tcsr_2 * 1 bit bit name initial value r/w description 7cmfb 0 r/(w) * 2 compare-match flag b [setting condition] when tcnt = tcorb [clearing conditions] ? read cmfb when cmfb = 1, then write 0 in cmfb ? when dtc is activated by cmib interrupt while disel bit of mrb in dtc is 0 with the transfer counter not being 0 6 cmfa 0 r/(w) * 2 compare-match flag a [setting condition] when tcnt = tcora [clearing conditions] ? read cmfa when cmfa = 1, then write 0 in cmfa ? when dtc is activated by cmia interrupt while disel bit of mrb in dtc is 0 with the transfer counter not being 0 5ovf 0 r/(w) * 2 timer overflow flag [setting condition] when tcnt overflows from h'ff to h'00 [clearing condition] read ovf when ovf = 1, then write 0 in ovf 4 ? 0r/wreserved this bit is a readable/writable bit, but the write value should always be 0.
section 12 8-bit timers rev. 5.00 aug 08, 2006 page 452 of 982 rej09b0054-0500 bit bit name initial value r/w description 3 2 os3 os2 0 0 r/w r/w output select 3 and 2 these bits specify how the timer output level is to be changed by a compare-match b of tcorb and tcnt. 00: no change when compare-match b occurs 01: 0 is output when compare-match b occurs 10: 1 is output when compare-match b occurs 11: output is inverted when compare-match b occurs (toggle output) 1 0 os1 os0 0 0 r/w r/w output select 1 and 0 these bits specify how the timer output level is to be changed by a compare-match a of tcora and tcnt. 00: no change when compare-match a occurs 01: 0 is output when compare-match a occurs 10: 1 is output when compare-match a occurs 11: output is inverted when compare-match a occurs (toggle output) notes: 1. not available in the h8s/2237 group and h8s/2227 group. 2. only 0 can be written to this bit, to clear the flag. 12.4 operation 12.4.1 pulse output figure 12.2 shows an example of arbitrary duty pulse output. 1. set tcr in ccr1 to 0 and cclr0 to 1 to clear tcnt by a tcora compare-match. 2. set os3 to os0 bits in tcsr to b'0110 to output 1 by a compare-match a and 0 by compare- match b. by the above settings, waveforms with the cycle of tcora and the pulse width of tcrb can be output without software intervention.
section 12 8-bit timers rev. 5.00 aug 08, 2006 page 453 of 982 rej09b0054-0500 tcnt h'ff counter clear tcora tcorb h'00 tmo figure 12.2 example of pulse output 12.5 operation timing 12.5.1 tcnt incrementation timing figure 12.3 shows the tcnt count timing with internal clock source. figure 12.4 shows the tcnt incrementation timing with external clock source. the pulse width of the external clock for incrementation at signal edge must be at least 1.5 system clock ( ) periods, and at least 2.5 states for incrementation at both edges. the counter will not increment correctly if the pulse width is less than these values. internal clock tcnt input clock tcnt n ? 1 n n + 1 figure 12.3 count timing for internal clock input
section 12 8-bit timers rev. 5.00 aug 08, 2006 page 454 of 982 rej09b0054-0500 external clock input pin tcnt input clock tcnt n ? 1 n n + 1 figure 12.4 count timing for external clock input 12.5.2 timing of cmfa and cmfb setting when a compare-match occurs the cmfa and cmfb flags in tcsr are set to 1 by a compare-match signal generated when the tcor and tcnt values match. the compare-match signal is generated at the last state in which the match is true, just before the timer counter is updated. therefore, when tcor and tcnt match, the compare-match signal is not generated until the next incrementation clock input. figure 12.5 shows the timing of cmf flag setting. tcnt nn + 1 tcor n compare-match signal cmf figure 12.5 timing of cmf setting
section 12 8-bit timers rev. 5.00 aug 08, 2006 page 455 of 982 rej09b0054-0500 12.5.3 timing of timer output when a compare-match occurs when a compare-match occurs, the timer output changes as specified by the output select bits (os3 to os0) in tcsr. figure 12.6 shows the timing when the output is set to toggle at compare- match a. compare-match a signal timer output pin figure 12.6 timing of timer output 12.5.4 timing of compare-match clear when a compare-match occurs tcnt is cleared when compare-match a or b occurs, depending on the setting of the cclr1 and cclr0 bits in tcr. figure 12.7 shows the timing of this operation. n h'00 compare-match signal tcnt figure 12.7 timing of compare-match clear
section 12 8-bit timers rev. 5.00 aug 08, 2006 page 456 of 982 rej09b0054-0500 12.5.5 tcnt external reset timing tcnt is cleared at the rising edge of an external reset input, depending on the settings of the cclr1 and cclr0 bits in tcr. the width of the clearing pulse must be at least 1.5 states. figure 12.8 shows the timing of this operation. clear signal external reset input pin tcnt n h'00 n ? 1 figure 12.8 timing of clearing by external reset input 12.5.6 timing of overflow flag (ovf) setting ovf in tcsr is set to 1 when the timer count overflows (changes from h'ff to h'00). figure 12.9 shows the timing of this operation. ovf overflow signal tcnt h'ff h'00 figure 12.9 timing of ovf setting
section 12 8-bit timers rev. 5.00 aug 08, 2006 page 457 of 982 rej09b0054-0500 12.6 operation with cascaded connection if bits cks2 to cks0 in one of tcr_0 and tcr_1 (tcr_2 and tcr_3)* are set to b'100, the 8- bit timers of the two channels are cascaded. with this configuration, a single 16-bit timer can be used (16-bit timer mode) or compare-matches of 8-bit channel 0 (channel 2)* can be counted by the timer of channel 1 (channel 3)* (compare-match count mode). in the case that channel 0 is connected to channel 1 in cascade, the timer operates as described below. note: * not available in the h8s/2237 group and h8s/2227 group. 12.6.1 16-bit count mode when bits cks2 to cks0 in tcr_0 are set to b'100, the timer functions as a single 16-bit timer with channel 0 occupying the upper 8 bits and channel 1 occupying the lower 8 bits. ? setting of compare-match flags ? the cmf flag in tcsr_0 is set to 1 when a 16-bit compare-match occurs. ? the cmf flag in tcsr_1 is set to 1 when a lower 8-bit compare-match occurs. ? counter clear specification ? if the cclr1 and cclr0 bits in tcr_0 have been set for counter clear at compare-match, the 16-bit counter (tcnt_0 and tcnt_1 together) is cleared when a 16-bit compare- match occurs. the 16-bit counter (tcnt_0 and tcnt_1 together) is cleared even if counter clear by the tmri01 pin has also been set. ? the settings of the cclr1 and cclr0 bits in tcr_1 are ignored. the lower 8 bits cannot be cleared independently. ? pin output ? control of output from the tmo0 pin by bits os3 to os0 in tcsr_0 is in accordance with the 16-bit compare-match conditions. ? control of output from the tmo1 pin by bits os3 to os0 in tcsr_1 is in accordance with the lower 8-bit compare-match conditions. 12.6.2 compare-match count mode when bits cks2 to cks0 in tcr_1 are b'100, tcnt_1 counts compare-match a for channel 0. channels 0 and 1 are controlled independently. conditions such as setting of the cmf flag, generation of interrupts, output from the tmo pin, and counter clearing are in accordance with the settings for each channel.
section 12 8-bit timers rev. 5.00 aug 08, 2006 page 458 of 982 rej09b0054-0500 12.7 interrupt sources 12.7.1 interrupt sources and dtc activation the 8-bit timer can generate three types of interrupt: cmia, cmib, and ovi. table 12.2 shows the interrupt sources and priority. each interrupt source can be enabled or disabled independently by interrupt enable bits in tcr. independent signals are sent to the interrupt controller for each interrupt. it is also possible to activate the dtc by means of cmia and cmib interrupts. table 12.2 8-bit timer interrupt sources interrupt source description flag dtc activation interrupt priority cmia0 tcora_0 compare-match cmfa possible high cmib0 tcorb_0 compare-match cmfb possible ovi0 tcnt_0 overflow ovf not possible low cmia1 tcora_1 compare-match cmfa possible high cmib1 tcorb_1 compare-match cmfb possible ovi1 tcnt_1 overflow ovf not possible low cmia2 * tcora_2 compare-match cmfa possible high cmib2 * tcorb_2 compare-match cmfb possible ovi2 * tcnt_2 overflow ovf not possible low cmia3 * tcora_3 compare-match cmfa possible high cmib3 * tcorb_3 compare-match cmfb possible ovi3 * tcnt_3 overflow ovf not possible low note: * not available in the h8s/2237 group and h8s/2227 group. 12.7.2 a/d converter activation the a/d converter can be activated only by channel 0 compare match a. if the adte bit in tcsr0 is set to 1 when the cmfa flag is set to 1 by the occurrence of channel 0 compare match a, a request to start a/d conversion is sent to the a/d converter. if the 8-bit timer conversion start trigger has been selected on the a/d converter side at this time, a/d conversion is started.
section 12 8-bit timers rev. 5.00 aug 08, 2006 page 459 of 982 rej09b0054-0500 12.8 usage notes 12.8.1 contention between tcnt write and clear if a timer counter clock pulse is generated during the t 2 state of a tcnt write cycle, the clear takes priority, so that the counter is cleared and the write is not performed. figure 12.10 shows this operation. address tcnt address internal write signal counter clear signal tcnt n h'00 t 1 t 2 tcnt write cycle by cpu figure 12.10 contention between tcnt write and clear 12.8.2 contention between tcnt write and increment if a timer counter clock pulse is generated during the t 2 state of a tcnt write cycle, the write takes priority and the counter is not incremented. figure 12.11 shows this operation.
section 12 8-bit timers rev. 5.00 aug 08, 2006 page 460 of 982 rej09b0054-0500 address tcnt address internal write signal tcnt input clock tcnt nm t 1 t 2 tcnt write cycle by cpu counter write data figure 12.11 contention between tcnt write and increment 12.8.3 contention between tcor write and compare-match during the t 2 state of a tcor write cycle, the tcor write has priority even if a compare-match occurs and the compare-match signal is disabled. figure 12.12 shows this operation. address tcor address internal write signal tcnt tcor nm t 1 t 2 tcor write cycle by cpu tcor write data n n + 1 compare-match signal prohibited figure 12.12 contention between tcor write and compare-match
section 12 8-bit timers rev. 5.00 aug 08, 2006 page 461 of 982 rej09b0054-0500 12.8.4 contention between compare-matches a and b if compare-matches a and b occur at the same time, the 8-bit timer operates in accordance with the priorities for the output states set for compare-match a and compare-match b, as shown in table 12.3. table 12.3 timer output priorities output setting priority toggle output high 1 output 0 output no change low 12.8.5 switching of internal clocks and tcnt operation tcnt may increment erroneously when the internal clock is switched over. table 12.4 shows the relationship between the timing at which the internal clock is switched (by writing to the cks1 and cks0 bits) and the tcnt operation when the tcnt clock is generated from an internal clock, the falling edge of the internal clock pulse is detected. if clock switching causes a change from high to low level, as shown in no. 3 in table 12.4, a tcnt clock pulse is generated on the assumption that the switchover is a falling edge. this increments tcnt. erroneous incrementation can also happen when switching between internal and external clocks.
section 12 8-bit timers rev. 5.00 aug 08, 2006 page 462 of 982 rej09b0054-0500 table 12.4 switching of internal clock and tcnt operation no. timing of switchover by means of cks1 and cks0 bits tcnt clock operation 1 switching from low to low * 1 clock before switchover clock after switchover tcnt clock tcnt cks bit rewrite nn + 1 2 switching from low to high * 2 clock before switchover clock after switchover tcnt clock tcnt cks bit rewrite nn + 1 n + 2
section 12 8-bit timers rev. 5.00 aug 08, 2006 page 463 of 982 rej09b0054-0500 no. timing of switchover by means of cks1 and cks0 bits tcnt clock operation 3 switching from high to low * 3 clock before switchover clock after switchover tcnt clock tcnt cks bit rewrite nn + 1 n + 2 * 4 4 switching from high to high clock before switchover clock after switchover tcnt clock tcnt cks bit rewrite nn + 1 n + 2 notes: 1. includes switching from low to stop, and from stop to low. 2. includes switching from stop to high. 3. includes switching from high to stop. 4. generated on the assumption that the switchover is a falling edge; tcnt is incremented. 12.8.6 contention between interrupts and module stop mode if module stop mode is entered when an interrupt has been requested, it will not be possible to clear the cpu interrupt source or the dtc activation source. interrupts should therefore be disabled before entering module stop mode. 12.8.7 mode setting of cascaded connection when the 16-bit count mode and the compare-match count mode are set at the same time, input clocks for tcnt_0 and tcnt_1 (tcnt_2 and tcnt_3) * are not generated and the timer stops incrementation. this setting is prohibited. note: * not available in the h8s/2237 group and h8s/2227 group.
section 12 8-bit timers rev. 5.00 aug 08, 2006 page 464 of 982 rej09b0054-0500
section 13 watchdog timer (wdt) rev. 5.00 aug 08, 2006 page 465 of 982 rej09b0054-0500 section 13 watchdog timer (wdt) the watchdog timer (wdt) is an 8-bit timer that can generate an internal reset signal for this lsi if a system crash prevents the cpu from writing to the timer counter, thus allowing it to overflow. when this watchdog function is not needed, the wdt can be used as an interval timer. in interval timer operation, an interval timer interrupt is generated each time the counter overflows. the block diagram of the wdt is shown in figure 13.1. 13.1 features ? selectable from 8 counter input clocks for wdt_0 selectable from 16 counter input clocks for wdt_1 ? switchable between watchdog timer mode and interval timer mode in watchdog timer mode ? choosable between power-on reset or manual reset as internal reset ? if the counter in wdt_0 overflows, it is possible to select whether this lsi is internally reset or not ? if the counter in wdt_1 overflows, it is possible to select whether this lsi is internally reset or the internal nmi interrupt is generated in interval timer mode ? if the counter overflows, the wdt generates an interval timer interrupt (wovi) ? the selected clock can be output from the buzz output pin (wdt_1)
section 13 watchdog timer (wdt) rev. 5.00 aug 08, 2006 page 466 of 982 rej09b0054-0500 overflow interrupt control wovi (interrupt request signal) internal reset signal * 1 reset control rstcsr tcnt_0 tcsr_0 /2 /64 /128 /512 /2048 /8192 /32768 /131072 clock clock select internal clock sources bus interface module bus tcsr_0: tcnt_0: rstcsr: notes: 1. the type of internal reset signal depends on a register setting. the power-on reset or manual reset can be selected as the internal reset. 2. when a sub-clock is operating in power-down mode, will be sub . timer control/status register0 timer counter0 reset control/status register wdt legend: internal bus * 2 figure 13.1 block diagram of wdt_0 (1)
section 13 watchdog timer (wdt) rev. 5.00 aug 08, 2006 page 467 of 982 rej09b0054-0500 overflow interrupt control wovi (interrupt request signal) internal nmi (interrupt request signal) internal reset signal * reset control tcnt_1 tcsr_1 /2 /64 /128 /512 /2048 /8192 /32768 /131072 sub/2 sub/4 sub/8 sub/16 sub/32 sub/64 sub/128 sub/256 clock clock select internal clock sources bus interface module bus internal bus wdt tcsr_1: tcnt_1: note: * the type of internal reset signal depends on a register setting. caused reset is the power-on reset. timer control/status register1 timer counter1 legend: buzz figure 13.1 block diagram of wdt_1 (2) 13.2 input/output pins table 13.1 pin configuration name symbol i/o function buzzer output buzz output output the clock selected by wdt_1 13.3 register descriptions the wdt has the following three registers. to prevent accidental overwriting, tcsr, tcnt, and rstcsr have to be written to by a different method to normal registers. for details, refer to section 13.6.1, notes on register access. for details on the system control register and pin function control register, refer to section 3.2.2, system control register (syscr) and section 7.3.6, pin function control register (pfcr), respectively. ? timer counter (tcnt) ? timer control/status register (tcsr) ? reset control/status register (rstcsr)
section 13 watchdog timer (wdt) rev. 5.00 aug 08, 2006 page 468 of 982 rej09b0054-0500 13.3.1 timer counter (tcnt) tcnt is an 8-bit readable/writable up-counter. tcnt is initialized to h'00 when the tme bit in tcsr is cleared to 0. 13.3.2 timer control/status register (tcsr) tcsr functions include selecting the clock source to be input to tcnt and the timer mode. ? tcsr_0 bit bit name initial value r/w description 7ovf 0 r/(w) * 1 overflow flag indicates that tcnt has overflowed. only a 0 can be written to this bit, to clear the flag. [setting condition] when tcnt overflows (changes from h'ff to h'00) when internal reset request generation is selected in watchdog timer mode, ovf is cleared automatically by the internal reset. [clearing condition] cleared by reading tcsr * 2 when ovf = 1, then writing 0 to ovf 6wt/ it 0 r/w timer mode select selects whether the wdt is used as a watchdog timer or interval timer. 0: interval timer mode (an interval timer interrupt (wovi) is requested to cpu) 1: watchdog timer mode (internal reset selectable) 5 tme 0 r/w timer enable when this bit is set to 1, tcnt starts counting. when this bit is cleared, tcnt stops counting and is initialized to h'00. 4, 3 ? all 1 ? reserved these bits are always read as 1 and cannot be modified.
section 13 watchdog timer (wdt) rev. 5.00 aug 08, 2006 page 469 of 982 rej09b0054-0500 bit bit name initial value r/w description 2 1 0 cks2 cks1 cks0 0 0 0 r/w r/w r/w clock select 0 to 2 selects the clock source to be input to tcnt. the overflow frequency * 3 for = 10 mhz is enclosed in parentheses. 000: clock /2 (frequency: 51.2 s) 001: clock /64 (frequency: 1.6 ms) 010: clock /128 (frequency: 3.2 ms) 011: clock /512 (frequency: 13.2 ms) 100: clock /2048 (frequency: 52.4 ms) 101: clock /8192 (frequency: 209.8 ms) 110: clock /32768 (frequency: 838.8 ms) 111: clock /131072 (frequency: 3.36 s) notes: 1. only 0 can be written, for flag clearing. 2. when the ovf flag is polled with the interval timer interrupt disabled, read the ovf bit while it is 1 at least twice. 3. the overflow period is the time from when tcnt starts counting up from h'00 until overflow occurs.
section 13 watchdog timer (wdt) rev. 5.00 aug 08, 2006 page 470 of 982 rej09b0054-0500 ? tcsr_1 bit bit name initial value r/w description 7ovf 0 r/(w) * 1 overflow flag indicates that tcnt has overflowed. only a 0 can be written to this bit, to clear the flag. [setting condition] when tcnt overflows (changes from h'ff to h'00) when internal reset request generation is selected in watchdog timer mode, ovf is cleared automatically by the internal reset. [clearing condition] cleared by reading tcsr * 2 when ovf = 1, then writing 0 to ovf 6wt/ it 0 r/w timer mode select selects whether the wdt is used as a watchdog timer or interval timer. 0: interval timer mode (an interval timer interrupt (wovi) is requested to cpu) 1: watchdog timer mode (a power-on reset or nmi interrupt is requested to cpu) 5 tme 0 r/w timer enable when this bit is set to 1, tcnt starts counting. when this bit is cleared, tcnt stops counting and is initialized to h'00. 4 pss 0 r/w prescaler select selects the clock source input to tcnt of wdt_1 0: tcnt counts divided clock of -base prescaler (psm) 1: tcnt counts divided clock of sub -base prescaler (pss) 3rst/ nmi 0 r/w reset or nmi (rst/ nmi ) when tcnt overflows in watchdog timer mode, either a power-on reset or nmi interrupt is selected. 0: an nmi interrupt is requested 1: reset is requested
section 13 watchdog timer (wdt) rev. 5.00 aug 08, 2006 page 471 of 982 rej09b0054-0500 bit bit name initial value r/w description 2 1 0 cks2 cks1 cks0 0 0 0 r/w r/w r/w clock select 0 to 2 selects the clock source to be input to tcnt. the overflow frequency * 3 for = 10 mhz is enclosed in parentheses. when pss = 0: 000: clock /2 (frequency: 51.2 s) 001: clock /64 (frequency: 1.6 ms) 010: clock /128 (frequency: 3.2 ms) 011: clock /512 (frequency: 13.2 ms) 100: clock /2048 (frequency: 52.4 ms) 101: clock /8192 (frequency: 209.8 ms) 110: clock /32768 (frequency: 838.8 ms) 111: clock /131072 (frequency: 3.36 s) when pss = 1: 000: clock sub /2 (frequency: 15.6 ms) 001: clock sub /4 (frequency: 31.3 ms) 010: clock sub /8 (frequency: 62.5 ms) 011: clock sub /16 (frequency: 125 ms) 100: clock sub /32 (frequency: 250 ms) 101: clock sub /64 (frequency: 500 ms) 110: clock sub /128 (frequency: 1 s) 111: clock sub /256 (frequency: 2 s) notes: 1. only 0 can be written, for flag clearing. 2. when the ovf flag is polled with the interval timer interrupt disabled, read the ovf bit while it is 1 at least twice 3. the overflow period is the time from when tcnt starts counting up from h'00 until overflow occurs.
section 13 watchdog timer (wdt) rev. 5.00 aug 08, 2006 page 472 of 982 rej09b0054-0500 13.3.3 reset control/status register (rstcsr) (only wdt_0) rstcsr controls the generation of the internal reset signal when tcnt overflows, and selects the type of internal reset signal. rstcsr is initialized to h'1f by a reset signal from the res pin, and not by the wdt internal reset signal caused by overflows. bit bit name initial value r/w description 7wovf0 r/(w) * watchdog overflow flag this bit is set when tcnt overflows in watchdog timer mode. this bit cannot be set in interval timer mode, and only 0 can be written, to clear the flag. [setting condition] set when tcnt overflows (changed from h'ff to h'00) in watchdog timer mode [clearing condition] cleared by reading rstcsr when wovf = 1, and then writing 0 to wovf 6 rste 0 r/w reset enable specifies whether or not a reset signal is generated in the chip if tcnt overflows during watchdog timer operation. 0: reset signal is not generated even if tcnt overflows (though this lsi is not reset, tcnt and tcsr in wdt are reset) 1: reset signal is generated if tcnt overflows 5 rsts 0 r/w reset select this bit selects the type of the internal reset that is generated by tcnt overflowing in watchdog timer mode. 0: power-on reset 1: manual reset 4 to 0 ? all 1 ? reserved these bits are always read as 1 and cannot be modified. note: * only 0 can be written, to clear the flag.
section 13 watchdog timer (wdt) rev. 5.00 aug 08, 2006 page 473 of 982 rej09b0054-0500 13.4 operation 13.4.1 watchdog timer mode to use the wdt as a watchdog timer, set the wt/ it bit in tcsr and the tme bit to 1. software must prevent tcnt overflows by rewriting the tcnt value (normally be writing h'00) before overflows occurs. thus, tcnt does not overflow while the system is operating normally. when the wdt is used as a watchdog timer and the rste bit in rstcsr of wdt_0 is set to 1, and if tcnt overflows without being rewritten because of a system malfunction or other error, an internal reset signal for this lsi is output for 518 system clocks. when the rst/ nmi bit in tcsr of wdt_1 is set to 1, and if tcnt overflows, the internal reset signal is output for 516 system clock periods. when the rst/ nmi bit is cleared to 0, an nmi interrupt request is generated (for 515 or 516 system clock periods when the clock source is set to sub (pss = 1)). an internal reset request from the watchdog timer and a reset input from the res pin are both treated as having the same vector. if a wdt internal reset request and the res pin reset occur at the same time, the res pin reset has priority and the wovf bit in rstcsr is cleared to 0. an nmi request from the watchdog timer and an interrupt request from the nmi pin are both treated as having the same vector. so, avoid handling an nmi request from the watchdog timer and an interrupt request from the nmi pin at the same time.
section 13 watchdog timer (wdt) rev. 5.00 aug 08, 2006 page 474 of 982 rej09b0054-0500 tcnt value h'00 time h'ff wt/ it =1 tme=1 write h'00' to tcnt wt/ it =1 tme=1 write h'00' to tcnt 518 system clock (wdt0) 515/516 system clock (wdt1) internal reset signal * wt/ it : tme: wovf: note: * in the case of wdt_0, the internal reset signal is generated only when the rste bit is set to 1. in the case of wdt_1,either the internal reset or the nmi interrupt is generated. overflow internal reset is generated wovf=1 timer mode select bit timer enable bit overflow flag legend: figure 13.2 watchdog timer mode operation 13.4.2 interval timer mode to use the wdt as a watchdog timer, set the wt/ it and tme bits in tcsr to 1. when the wdt is used as an interval timer, an interval timer interrupt (wovi) is generated each time the tcnt overflows. (the nmi interrupt is not generated.) therefore, an interrupt can be generated at intervals.
section 13 watchdog timer (wdt) rev. 5.00 aug 08, 2006 page 475 of 982 rej09b0054-0500 tcnt value h'00 time h'ff wt/ it =0 tme=1 wovi overflow overflow overflow overflow legend: wovi: interval timer interrupt request generation wovi wovi wovi figure 13.3 interval timer mode operation 13.4.3 timing of setting overflow flag (ovf) the ovf flag is set to 1 if tcnt overflows during interval timer operation. at the same time, an interval timer interrupt (wovi) is requested. this timing is shown in figure 13.4. when nmi request is chosen in watchdog timer mode for wdt_1, tcnt overflow sets the ovf flog to 1. at the same time, nmi interrupt is requested. tcnt h'ff h'00 ovf overflow signal (internal signal) figure 13.4 timing of ovf setting
section 13 watchdog timer (wdt) rev. 5.00 aug 08, 2006 page 476 of 982 rej09b0054-0500 13.4.4 timing of setting watchdog timer overflow flag (wovf) with wdt_0 the wovf bit in rstcsr is set to 1 if tcnt overflows in watchdog timer mode. if tcnt overflows while the rste bit in rstcsr is set to 1, an internal is generated for the entire chip. (the wovi interrupt is not generated.) this timing is illustrated in figure 13.5. tcnt h'ff h'00 overflow signal (internal signal) wovf internal reset signal 518 states (wdt_0) 515/516 states (wdt_1) figure 13.5 timing of wovf setting 13.5 interrupt sources during interval timer mode operation, an overflow generates an interval timer interrupt (wovi). the interval timer interrupt is requested whenever the ovf flag is set to 1 in tcsr. ovf must be cleared to 0 in the interrupt handling routine. if an nmi interrupt request has been chosen in the watchdog timer mode, an nmi interrupt request is generated when a tcnt overflow occurs. table 13.2 wdt interrupt source name interrupt source interrupt flag wovi tcnt overflow (interval timer mode) ovf nmi tcnt overflow (watchdog timer mode) ovf
section 13 watchdog timer (wdt) rev. 5.00 aug 08, 2006 page 477 of 982 rej09b0054-0500 13.6 usage notes 13.6.1 notes on register access the write method for tcnt, tcsr, and rstcsr differs from that of normal registers so that they cannot be easily rewritten. use the following procedures to read and write these registers. (1) writing to tcnt and tcsr word transfer instructions must be used to write to tcnt and tcsr. these registers cannot be written with byte transfer instructions. this is shown in figure 13.6. for writing, tcnt and tcsr are allocated to the same address. to write to tcnt, transfer a word in which the upper byte is h'5a and the lower byte is the write data. to write to tcsr, transfer a word in which the upper byte is h'a5 and the lower byte is the write data. when these transfer operations are performed, the lower byte data is written to tcnt or tcsr. tcnt write tcsr write address: address: 15 8 7 0 h'5a h'ff74 write data 15 8 7 0 h'a5 h'ff74 write data figure 13.6 writing to tcnt, tcsr (2) writing to rstcsr use word transfer operations to write to rstcsr. this register cannot be written using byte transfer instructions. this is shown in figure 13.7. the method used to write a 0 to the wovf bit and the method used to write the rste and rsts bits are different. to write a 0 to the wovf bit, set the upper byte to h'a5 and the lower byte to h'00 and transfer that data. this will clear the wovf bit to 0. this operation does not affect the rste and rsts bits. to write the rste and rsts bits, set the upper byte to h'5a and the lower byte to the data to be written and transfer that data. this will write the data in bits 6 and 5 of the lower byte to the rste and rsts bits. this operation does not affect the wovf bit.
section 13 watchdog timer (wdt) rev. 5.00 aug 08, 2006 page 478 of 982 rej09b0054-0500 when writing 0 to the wovf bit when writing to the rste and rsts bits address: address: 15 8 7 0 h'a5 h'ff76 h'00 15 8 7 0 h'5a h'ff76 write data figure 13.7 writing to rstcsr (3) reading from tcnt, tcsr, and rstcsr these registers can be read in the same way normal registers are read. tcsr is allocated at address h'ff74, tcnt at address h'ff75, and rstcsr at address h'ff77. 13.6.2 contention between timer counter (tcnt) write and increment if a timer counter clock pulse is generated during the t 2 state of a tcnt write cycle, the write takes priority and the timer counter is not incremented. figure 13.8 shows this operation. address internal write signal tcnt input clock tcnt nm t 1 t 2 tcnt write cycle counter write data figure 13.8 contention between tcnt write and increment
section 13 watchdog timer (wdt) rev. 5.00 aug 08, 2006 page 479 of 982 rej09b0054-0500 13.6.3 changing value of cks2 to cks0 if bits cks0 to cks2 in tcsr are written to while the wdt is operating, errors could occur in the incrementation. software must be used to stop the watchdog timer (by clearing the tme bit to 0) before changing the value of bits cks0 to cks2. 13.6.4 switching between watchdog timer mode and interval timer mode if the mode is switched from watchdog timer to interval timer while the wdt is operating, errors could occur in the incrementation. software must be used to stop the watchdog timer (by clearing the tme bit to 0) before switching the mode. 13.6.5 internal reset in watchdog timer mode this lsi is not reset internally if tcnt overflows while the rste bit is cleared to 0 during watchdog timer operation, however tcnt_0 and tcsr_0 of the wdt_0 are reset. tcnt, tcsr, or rstcr cannot be written to for 132 states following an overflow. during this period, any attempt to read the wovf flag is not acknowledged. accordingly, wait 132 states after overflow to write 0 to the wovf flag for clearing. 13.6.6 ovf flag clearing in interval timer mode when the ovf flag setting conflicts with the ovf flag reading in interval timer mode, writing 0 to the ovf bit may not clear the flag even though the ovf bit has been read while it is 1. if there is a possibility that the ovf flag setting and reading will conflict, such as when the ovf flag is polled with the interval timer interrupt disabled, read the ovf bit while it is 1 at least twice before writing 0 to the ovf bit to clear the flag.
section 13 watchdog timer (wdt) rev. 5.00 aug 08, 2006 page 480 of 982 rej09b0054-0500
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 481 of 982 rej09b0054-0500 section 14 iebus ? controller (ieb) [h8s/2258 group] this lsi has an on-chip one-channel iebus? controller (ieb). the inter equipment bus ? (iebus ? )* 1 is a small-scaled digital data transfer system for inter equipment data transfer. this lsi does not have an on-chip iebus driver/receiver, so it is necessary to mount a dedicated driver/receiver* 2 externally. notes: 1. iebus is a trademark of nec electronics corporation. 2. bus interface driver/receiver ic: ha12187fp is recommended. 14.1 features ? iebus protocol control (layer 2) supported ? half duplex asynchronous communications ? multi-master system ? broadcast communications function ? selectable mode (three types) with different transfer speeds ? data transfer by the data transfer controller (dtc) ? transfer buffer: 1 byte ? reception buffer: 1 byte ? up to 128 bytes of consecutive transfer/reception (maximum number of transfer bytes in mode 2) ? operating frequency ? 12 mhz, 12.58 mhz (ieb uses 1/2 divided external clock) note: 1.5% when mode 0 or 1 is used, 0.5% when mode 2 is used ? noise resistance is improved by mounting the iebus driver/receiver (layer 1) externally ? module stop mode can be set
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 482 of 982 rej09b0054-0500 figure 14.1 shows an ieb block diagram. rx iear1 iema1 iela1 iema2 iecmr ietsr ieiet ietef iersr ieier ieref iectr iear2 signal polarity select circuit bit timing set/ detect circuit iebus driver/receiver transmission block reception block internal data bus transmit shift register receive shift register data link layer control block status/interrupt control block ietxi (txrdy interrupt) ietsi (tx status interrupt) ierxi (rxrdy interrupt) iersi (rx status interrupt) conflict detect circuit parity generation circuit parity check circuit iesa1 iesa2 iemcr ietbfl ietbr ierctl ierbfl ierbr iela2 tx figure 14.1 block diagram of ieb
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 483 of 982 rej09b0054-0500 14.1.1 iebus communications protocol the overview of the iebus is described below. ? communications method: half duplex asynchronous communications ? multi-master system all units connected to the iebus can transfer data to other units. ? broadcast communications function (one-to-many communications) ? group broadcast communications: broadcast communications to group unit ? general broadcast communications: broadcast communications to all units ? mode is selectable (three modes with different transfer speeds). table 14.1 mode types mode = 12 mhz = 12.58 mhz maximum number of transfer bytes (byte/frame) 0 about 3.9 kbps about 4.1 kbps 16 1 about 17 kbps about 18 kbps 32 2 about 26 kbps about 27 kbps 128 ? access control: csma/cd (carrier sense multiple access with collision detection) priority of bus mastership is as follows. ? broadcast communications (one-to-many communications) have priority rather than normal communications (one-to-one communications). ? smaller master address has priority. ? communications scale ? number of units: up to 50 ? cable length: up to 150 m (when using a twisted pair cable) note: the communications scale of the actual system depends on the externally mounted iebus driver/receiver characteristics and the characteristics of the cable to be used. (1) determination of bus mastership (arbitration) a unit connected to the iebus performs an operation for getting the bus to control other units. this operation is called arbitration. in arbitration, when the multiple units start transfer simultaneously, the bus mastership is given to one unit among them. only one unit can get bus mastership through arbitration, so the following priority for bus mastership is defined.
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 484 of 982 rej09b0054-0500 (a) priority according to communications type broadcast communications (one-to-many communications) has priority over normal communications (one-to-one communications). (b) priority according to master address a unit with the smallest master address has priority among units with the same communications type. example: the master address is configured with 12 bits. a unit with h'000 has the highest priority, and a unit with h'fff has the lowest priority. note: when a unit loses arbitration, the unit can automatically enter retransfer mode (0 to 7 retransfer times can be selected by bits rn2 to rn0 in iemcr). (2) communications mode the iebus has three communications modes with different transfer speeds. table 14.2 shows the transfer speed in each communications mode and the maximum number of transfer bytes in one communications frame. table 14.2 transfer speed and maximum number of transfer bytes in each communications mode effective transfer speed * 1 (kbps) communications mode maximum number of transfer bytes (byte/frame) = 12 mhz * 2 = 12.58 mhz * 2 0 16 about 3.9 about 4.1 1 32 about 17 about 18 2 128 about 26 about 27 notes: each unit connected to the iebus should select a communications mode prior to performing communications. note that correct communications is not guaranteed if the master and slave units do not adopt the same communications mode. in the case of communications between a unit with = 12 mhz and a unit with = 12.58 mhz, correct communications is not possible even if the same communications mode is adopted. communications must be performed at the same oscillation frequency. 1. an effective transfer speed when the maximum number of transfer bytes is transmitted. 2. oscillation frequency when this lsi is used
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 485 of 982 rej09b0054-0500 (3) communications address in the iebus, a 12-bit specific communications addresses are allocated to individual units. a communications address is configured as follows. ? upper four bits: group number (number identifying a group to which the unit belongs) ? lower eight bits: unit number (number identifying individual units in a group) (4) broadcast communications in normal transfer, a single master unit communicates with a single slave unit. so, one-to-one transfer or reception is performed. in broadcast communications, a single master unit communicates with multiple slave units. since there are multiple slave units, acknowledgement is not returned from the slave units during communications. a broadcast bit decides whether broadcast or normal communications is performed. (for details of the broadcast bit, see section 14.1.2 (1) (b), broadcast bit. there are two types of broadcast communications. (a) group broadcast communications broadcast communications is performed to units with the same group number, meaning that those units have the same upper four bits of the communications address. (b) general broadcast communications broadcast communications is performed to all units regardless of the group number. group broadcast and general broadcast communications are identified by a slave address. (for details on the slave address, see section 14.1.2 (3), slave address field.) 14.1.2 communications protocol figure 14.2 shows an iebus transfer signal format. communications data is transferred as a series of signals referred to as a communications frame. the number of data which can be transmitted in a single communications frame and the transfer speed differ according to communications mode.
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 486 of 982 rej09b0054-0500 ppapapapa pa 1 field name header master address field slave address field approximately 7330 s approximately 2090 s approximately 1590 s approximately 1590 n s approximately 410 n s approximately 300 n s control field data field (when = 12 mhz) message length field number of bits transfer time mode 0 mode 1 mode 2 note: the value of acknowledge bit is ignored in broadcast communications. p: parity bit (1 bit) a: acknowledge bit (1 bit) when a = 0: ack when a = 1: nak n: number of bytes 1 start bit master address slave address control bits data bits data bits message length bits broad- cast bit 1114 811 811 811 11 12 12 figure 14.2 transfer signal format (1) header header is comprised of a start bit and a broadcast bit. (a) start bit the start bit is a signal for informing a start of data transfer to other units. a unit, which attempts to start data transfer, outputs a low-level signal (start bit) for a specified period and then outputs the broadcast bit. if another unit is already outputting a start bit when a unit attempts to output a start bit, the unit waits for completion of output of the start bit from the other unit without outputting the start bit, and then outputs the broadcast bit synchronized with the completion timing. other units enter the receive state after detecting the start bit. (b) broadcast bit the broadcast bit is a bit to identify the type of communications: broadcast or normal. when this bit is cleared to 0, it indicates the broadcast communications. when it is set to 1, it indicates the normal communications. broadcast communications includes group broadcast and general broadcast, which are identified by a value of the slave address. (for details of the slave address, see section 14.1.2 (3), slave address field.) since there are multiple slave units, which are communications destination units, in the case of broadcast communications, the acknowledge bit is not returned from each field described in (2) and below.
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 487 of 982 rej09b0054-0500 when more than one unit starts transfer of communications frame at the same timing, broadcast communications has priority over normal communications, and arbitration occurs. (2) master address field the master address field is a field for transmitting the unit address (master address) to other units. the master address field is comprised of master address bits and a parity bit. the master address has 12 bits and are output msb first. when more than one unit starts transfer of the broadcast bit having the same value at the same timing, arbitration is decided by the master address field. in the master address field, self-output data and data on the bus are compared for every one-bit transfer. if the self-output master address and data on the bus are different, the unit that loses arbitration, stops transfer, and enters the receive state. since the iebus is configured with wired and, a unit having the smallest master address of the units in arbitration (arbitration master) wins in arbitration. finally, only a single unit remains in the transfer state as a master unit after outputting 12-bit master address. next, this master unit outputs a parity bit*, defines the master address to other units, and then enters the slave address field output state. note: * since even parity is used, when the number of one bits in the master address is odd, the parity bit is 1. (3) slave address field the slave address field is a field to transmit an address (slave address) of a unit (slave unit) to which a master transmit data. the slave address field is comprised of slave address bits, a parity bit, and an acknowledge bit. the slave address has 12 bits and is output msb first. the parity bit is output after the 12-bit slave address is transmitted in order to avoid receiving the slave address accidentally. the master unit then detects the acknowledgement from the slave unit in order to confirm that the slave unit exists on the bus. when the acknowledgement is detected, the master unit enters the control field output state. however, the master unit enters the control field output state without detecting the acknowledgement in broadcast communications.
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 488 of 982 rej09b0054-0500 the slave unit returns the acknowledgement when the slave addresses match and the parities of the master and slave addresses are correct. when either of the parities of the master and slave addresses is wrong, the slave unit decides that the master or slave address is not correctly received and does not return the acknowledgement. in this case, the master unit enters the waiting (monitor) state, and communications end. in the case of broadcast communications, the slave address is used to identify the type of broadcast communications (group or general) as follows: ? when the slave address is h'fff: general broadcast communications ? when the slave address is other than h'fff: group broadcast communications note: the group number is the upper 4-bit value of the slave address in group broadcast communications. (4) control field the control field is a field for transmitting the type and direction of the following data field. the control field is comprised of control bits, a parity bit, and an acknowledge bit. the control bits include four bits and are output msb first. the parity bit is output following the control bits. when the parity is correct, and the slave unit can implement the function required from the master unit, the slave unit returns the acknowledgement and enters the message length field output state. however, if the slave unit cannot implement the requirements from the master unit even though the parity is correct, or if the parity is not correct, the slave unit does not return the acknowledgement, and returns to the waiting (monitor) state. the master unit enters the subsequent message length field output state after confirming the acknowledgement. when the acknowledgement is not confirmed, the master unit enters the waiting (monitor) state, and communications end. however, in the case of broadcast communications, the master unit enters the following message length field output state without confirming the acknowledgement. for details of the contents of the control bit, see table 14.4.
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 489 of 982 rej09b0054-0500 (5) message length field the message length field is a field for specifying the number of transfer bytes. the message length field is comprised of message length bits, a parity bit, and an acknowledge bit. the message length has eight bits and is output msb first. table 14.3 shows the number of transfer bytes. table 14.3 contents of message length bits message length bits (hexadecimal) number of transfer bytes h ' 01 h ' 02 . . h ' ff h ' 00 1 byte 2 bytes . . 255 bytes 256 bytes note: * if a number greater than the maximum number of transfer bytes in one frame is specified, communications are performed in multiple frames depending on the communications mode. in this case, the message length bits indicate the number of remaining communications data after the first transfer. in this lsi, after the first transfer, the message length bits must be specified to the number of remaining communications data by a program, since these bits are not automatically specified by the hardware. this field operation differs depending on the value of bit 3 in the control field: master transmission (bit 3 in the control bits is 1) or master reception (bit 3 in the control bits is 0). (a) master transmission the master unit outputs the message length bits and parity bit. when the parity is correct, the slave unit returns the acknowledgement and enters the following data field. note that the slave unit does not return the acknowledgement in broadcast communications. in addition, when the parity is not correct, the slave unit decides that the message length field is not correctly received, does not return the acknowledgement, and returns to the waiting (monitor) state. in this case, the master unit also returns to the waiting state, and communications end. (b) master reception the slave unit outputs the message length bits and parity bit. when the parity is correct, the master unit returns the acknowledgement. when the parity is not correct, the master unit decides that the message length bits are not correctly received, does not return the acknowledgement, and returns to the waiting state. in this case, the slave unit also returns to the waiting state, and communications end.
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 490 of 982 rej09b0054-0500 (6) data field the data field is a field for data transmission/reception to the slave unit. the master unit transmits/receives data to/from the slave unit using the data field. the data field is comprised of data bits, a parity bit, and an acknowledge bit. the data bits include eight bits and are output msb first. the parity bit and acknowledge bit following the data bits are output from the master unit and slave unit, respectively. broadcast communications are performed only for the transmission of the master unit. in this case, the acknowledge bit is ignored. operations in master transmission and master reception are described below. (a) master transmission the master unit transmits the data bits and parity bit to the slave unit to write data from the master unit to the slave unit. the slave unit receives the data bits and parity bit, and returns the acknowledgement if the parity bit is correct and the receive buffer is empty. if the parity bit is not correct or the receive buffer is not empty, the slave unit rejects acceptance of corresponding data and does not return the acknowledgement. when the slave unit does not return the acknowledgement, the master unit retransmits the same data. this operation is repeated until either the acknowledgement from the slave unit is detected or the maximum number of data transfer bytes is exceeded. when the parity is correct and the acknowledgement is output from the slave unit, the master unit transmits the subsequent data if data remains and the maximum number of transfer bytes is not exceeded. in the case of broadcast communications, the slave unit does not return the acknowledgement, and the master unit transfers data byte by byte. (b) master reception the master unit outputs synchronous signals corresponding to all data bits to be read from the slave unit. the slave unit outputs the data bits and parity bit on the bus in accordance with the synchronous signals from the master unit. the master unit reads the parity bit output from the slave unit, and checks the parity. if the parity is not correct, or the receive buffer is not empty, the master unit rejects acceptance of the data, and does not return the acknowledgement. the master unit reads the same data repeatedly if the number of data does not exceed the maximum number of transfer bytes in one frame. if the parity is correct and the receive buffer is empty, the master unit accepts data and returns the
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 491 of 982 rej09b0054-0500 acknowledgement. the master unit reads in the subsequent data if the number of data does not exceed the maximum number of transfer bytes in one frame. (7) parity bit the parity bit is used to confirm that transfer data has no error. the parity bit is added to respective data of the master address, slave address, control, message length, and data bits. the even parity is used. when the number of one bits in data is odd, the parity bit is 1. when the number of one bits in data is even, the parity bit is 0. (8) acknowledge bit in normal communications (a single unit to a single unit communications), the acknowledge bit is added to the following position in order to confirm that data is correctly accepted. ? at the end of the slave address field ? at the end of the control field ? at the end of the message length field ? at the end of the data field the acknowledge bit is defined below. ? 0: indicates that the transfer data is acknowledged. (ack) ? 1: indicates that the transfer data is not acknowledged. (nak) note that the acknowledge bit is ignored in the case of broadcast communications. (a) acknowledge bit at the end of the slave address field the acknowledge bit at the end of the slave address field becomes nak in the following cases and transfer is stopped. ? when the parity of the master address or slave address bits is incorrect ? when a timing error (an error in bit format) occurs ? when there is no slave unit (b) acknowledge bit at the end of the control field the acknowledge bit at the end of the control field becomes nak in the following cases and transfer is stopped. ? when the parity of the control bits is incorrect
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 492 of 982 rej09b0054-0500 ? when bit 3 in the control bits is 1 (data write) although the slave receive buffer* is not empty ? when the control bits are set to the data read (h'3, h'7) although the slave transmit buffer* is empty ? when another unit which locked the slave unit requests h'3, h'6, h'7, h'a, h'b, h'e, or h'f in the control bits although the slave unit has been locked ? when the control bits are the locked address read (h'4, h'5) although the unit is not locked ? when a timing error occurs ? when the control bits are undefined note: * see section 14.1.3 (1), slave status read (control bits: h'0, h'6). (c) acknowledge bit at the end of the message length field the acknowledge bit at the end of the message length field becomes nak in the following cases and transfer is stopped. ? when the parity of the message length bits is incorrect ? when a timing error occurs (d) acknowledge bit at the end of the data field the acknowledge bit at the end of the data field becomes nak in the following cases and transfer is stopped. ? when the parity of the data bits is incorrect* ? when a timing error occurs after the previous transfer of the acknowledge bit ? when the receive buffer becomes full and cannot accept further data note: * in this case, data field is transferred repeatedly until the number of data reaches the maximum number of transfer bytes if the number of data does not exceed the maximum number of transfer bytes in one frame.
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 493 of 982 rej09b0054-0500 14.1.3 transfer data (data field contents) the data filed contents are specified by the control bits. table 14.4 control bit contents setting value bit 3 * 1 bit 2 bit 1 bit 0 function * 2 h ' 0 0 0 0 0 reads slave status (ssr) h ' 1 0 0 0 1 undefined ? do not use h ' 2 0 0 1 0 undefined ? do not use h ' 3 0 0 1 1 reads data and locks h ' 4 0 1 0 0 reads locked address (lower 8 bits) h ' 5 0 1 0 1 reads locked address (upper 4 bits) h ' 6 0 1 1 0 reads slave status (ssr) and unlocks h ' 7 0 1 1 1 reads data h ' 8 1 0 0 0 undefined ? do not use h ' 9 1 0 0 1 undefined ? do not use h ' a 1 0 1 0 writes command and locks h ' b 1 0 1 1 writes data and locks h ' c 1 1 0 0 undefined ? do not use h ' d 1 1 0 1 undefined ? do not use h ' e1110writes command h ' f1111writes data notes: 1. according to the value of bit 3 (msb), the transfer directions of the message length bits in the following message length field and data in the data field vary. when bit 3 is 1: data is transferred from the master unit to the slave unit. when bit 3 is 0: data is transferred from the slave unit to the master unit. 2. h ' 3, h ' 6, h ' a, and h ' b are control bits to specify lock setting and cancellation. when the undefined values of h ' 1, h ' 2, h ' 8, h ' 9, h ' c, and h ' d are transmitted, the acknowledge bit is not returned. when the control bits received from another unit which locked are not included in table 14.5, the slave unit which has been locked by the master unit rejects acceptance of the control bits and does not return the acknowledge bit.
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 494 of 982 rej09b0054-0500 table 14.5 control field for locked slave unit setting value bit 3 bit 2 bit 1 bit 0 function h ' 0 0 0 0 0 reads slave status h ' 4 0 1 0 0 reads locked address (upper 8 bits) h ' 5 0 1 0 1 reads locked address (lower 4 bits) (1) slave status read (control bits: h'0, h'6) the master unit can decide the reason the slave unit does not return the acknowledgement (ack) by reading the slave status (h'0, h'6). the slave status indicates the result of the last communications that the slave unit performs. all slave units can provide slave status information. figure 14.3 shows bit configuration of the slave status. msb bit 7 notes: 1. since this lsi can support up to mode 2, bits 6 and 7 are fixed to 10. 2. the value of bit 4 can be selected by the ste bit in the iebus master unit address register 1 (iear1). 3. the slave receive buffer is a buffer which is accessed during data write (control bits: h'8, h'a, h'b, h'e, h'f). in this lsi, the slave receive buffer corresponds to the iebus receive buffer register (ierbr); and bit 2 is the value of the rxrdy flag in the iebus receive status register (iersr). 4. the slave transmit buffer is a buffer which is accessed during data read (control bits: h'3, h'7). in this lsi, the slave transmit buffer corresponds to the iebus transmit buffer register (ietbr) when srq = 1 in the iebus general flag register (ieflg); and bit 1 is a value which reverses the txrdy flag in the iebus transmit/runaway status register (ietsr). bit 7, bit 6 bit 5 bit 3 bit 2 bit 4 * 2 bit 1 * 3 bit 0 * 4 00 01 10 11 mode 0 indicates the highest mode supported by a unit. * 1 mode 1 mode 2 for future use fixed 0 fixed 0 slave transmission halted slave transmission enabled slave receive buffer is empty slave receive buffer is not empty slave transmit buffer is empty slave transmit buffer is not empty unit is unlocked unit is locked 0 0 0 0 1 1 1 1 0 0 bit value description bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 lsb figure 14.3 bit configuration of slave status (ssr)
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 495 of 982 rej09b0054-0500 (2) data command transfer (control bits: read (h'3, h'7), write (h'a, h'b, h'e, h'f)) in the case of data read (h'3, h'7), data in the data buffer of the slave unit is read in the master unit. in the case of data write (h'b or h'f) or command write (h'a or h'e), data received in the slave unit is processed in accordance with the operation specification of the slave unit. notes: 1. the user can select data and commands freely in accordance with the system. 2. h'3, h'a, or h'b may lock depending on the communications condition and status. (3) locked address read (control bits: h'4, h'5) in the case of the locked address read (h'4 or h'5), the address (12 bits) of the master unit which issues lock instruction is configured in bytes shown in figure 14.4. msb lower 8 bits undefined control bits: h'4 control bits: h'5 upper 4 bits lsb figure 14.4 locked address configuration (4) locking/unlocking (control bits: setting (h'3, h'a, h'b), cancellation: (h'6)) the lock function is used for message transfer over multiple communications frames. locked unit receives data only from the unit which has locked. locking and unlocking are described below. ? locking when the acknowledge bit of 0 in the message length field is transmitted/received with the control bits indicating the lock operation, and then the communications frame is completed before completion of data transmission/reception for the number of bytes specified by the message length bits, the slave unit is locked by the master unit. in this case, the bit (bit 2) relevant to lock in the byte data indicating the slave status is set to 1. lock is set only when the number of data exceeds the maximum number of transfer bytes in one frame. lock is not set by other error termination. ? unlocking when the control bits indicate the lock (h'3, h'a, or h'b) or unlock (h'6) operation and the byte data for the number of bytes specified by the message length bits are transmitted/received
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 496 of 982 rej09b0054-0500 in a single communications frame, the slave unit is unlocked by the master unit. in this case, a bit (bit 2) relevant to lock in the byte indicating the slave status is cleared to 0. note that locking and unlocking are not performed in broadcast communications. note: * there are three methods to unlock by a locked unit itself. ? perform hardware reset ? enter module stop mode ? issue unlock command by the iebus command register (iecmr) note that the lck flag in ieflg can be used to check whether the unit is locked/unlocked. 14.1.4 bit format figure 14.5 shows the bit format (conceptual diagram) configuring the iebus communications frame. logic 1 logic 0 active low: logic 1 = low level and logic 0 = high level active high: logic 1 = high level and logic 0 = low level preparation period synchronous period data period halt period figure 14.5 iebus bit format (conceptual diagram) each period of bit format for use of active high signals is described below. ? preparation period: first logic 1 period (high level) ? synchronous period: subsequent logic 0 period (low level) ? data period: period indicating bit value (logic 1: high level, logic 0: low level) ? halt period: last logic 1 cycle (high level) for use of active low signals, levels are reversed from the active high signals. the synchronous and data periods have approximately the same length. the iebus is synchronized bit by bit. the specifications for the time of all bits and the periods allocated to the bits differ depending on the type of transfer bits and the unit (master or slave unit).
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 497 of 982 rej09b0054-0500 14.2 input/output pins table 14.6 shows the ieb pin configuration. table 14.6 pin configuration name abbreviation i/o function iebus transmit data pin tx output transmit data output pin iebus receive data pin rx input receive data input pin 14.3 register descriptions the ieb has the following registers. for the module stop control register, see section 24.1.2, module stop control registers a to c (mstpcra to mstpcrc). ? iebus control register (iectr) ? iebus command register (iecmr) ? iebus master control register (iemcr) ? iebus master unit address register 1 (iear1) ? iebus master unit address register 2 (iear2) ? iebus slave address setting register 1 (iesa1) ? iebus slave address setting register 2 (iesa2) ? iebus transmit message length register (ietbfl) ? iebus transmit buffer register (ietbr) ? iebus reception master address register 1 (iema1) ? iebus reception master address register 2 (iema2) ? iebus receive control field register (ierctl) ? iebus receive message length register (ierbfl) ? iebus receive buffer register (ierbr) ? iebus lock address register 1 (iela1) ? iebus lock address register 2 (iela2) ? iebus general flag register (ieflg) ? iebus transmit/runaway status register (ietsr) ? iebus transmit/runaway interrupt enable register (ieiet) ? iebus transmit error flag register (ietef) ? iebus receive status register (iersr) ? iebus receive interrupt enable register (ieier)
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 498 of 982 rej09b0054-0500 ? iebus receive error flag register (ieref) 14.3.1 iebus control register (iectr) iectr controls ieb operation (switches iebus pin/port functions, selects input/output level, and enables receive operation). bit bit name initial value r/w description 7 iee 0 r/w ieb pin switch switches ieb pin and port functions. 0: the pg3/ rx / cs1 and pg2/ tx / cs2 pins function as the pg3/ cs1 and pg2/ cs2 pins. 1: the pg3/ rx / cs1 and pg2/ tx / cs2 pins function as the tx and rx pins. 6 iol 0 r/w input/output level selects input/output pin level (polarity) for the rx and tx pins. 0: pin input/output is set to active low. (logic 1 is low level and logic 0 is high level.) 1: pin input/output is set to active high. (logic 1 is high level and logic 0 is low level.)
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 499 of 982 rej09b0054-0500 bit bit name initial value r/w description 5 dee 0 r/w broadcast receive error interrupt enable since the acknowledgement is not returned between the master and slave units in broadcast reception, the master unit cannot decide whether the slave unit is in the receive enabled state. if this bit is set to 1, a reception error interrupt occurs (note that there is not the corresponding bit in the iebus receive error flag register to this error) when the receive buffer is not in the receive enabled state during receiving the control field in broadcast reception (when the re bit is not set to 1 or the rxrdy flag is set.). at this time, the master address is stored in iema1 and iema2. the receive data is not stored in the ierctl. while this bit is 0, a reception error interrupt does not occur when the receive buffer is not in the receive enabled state, and the reception stops and enters the wait state. the master address is not saved. 0: a broadcast receive error is not generated up to the control field. 1: a broadcast receive error is generated up to the control field. 4 cks 0 r/w input clock select always set this bit to 0 in this lsi. selects clock used by the ieb. 3 re 0 r/w receive enable enables/disables ieb reception. this bit must be set at the initial setting before frame reception. changing this bit before receiving the control field is valid, however, changing this bit after receiving the control field is invalid and the value before the change is validated. 0: reception is disabled. 1: reception is enabled.
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 500 of 982 rej09b0054-0500 bit bit name initial value r/w description 2 luee 0 r/w last byte underrun enable sets whether to generate an underrun error when the last data field byte is transferred in data transmission. if the ieb reads from ietbr when the txrdy flag is set (the transmit buffer register (ietbr) is empty), an underrun error occurs. in transmission using the dtc, an underrun error occurs at the last byte transmission if the cpu did not clear the txrdy flag, because the dtc does not clear the txrdy flag. when the dtc is used, set this bit to 0 to mask an underrun error generated at the last byte transmission. when the dtc is not used, set this bit to 1 to generate an underrun error at the last byte transmission. 0: an underrun error does not occur at the last byte transmission (when using the dtc) 1: an underrun error does not occur at the last byte transmission (when not using the dtc) 1, 0 ? all 0 ? reserved this bit is always read as 0 and cannot be modified. 14.3.2 iebus command register (iecmr) iecmr issues commands to control ieb communications. since this register is a write-only register, bit-manipulation instructions should not be used when writing. see section 2.9.4, access methods for registers with write-only bits.
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 501 of 982 rej09b0054-0500 bit bit name initial value r/w description 7 to 3 ? all 0 ? reserved the read value is undefined. in order to avoid malfunction, do not use bit manipulation instructions. these bits cannot be modified. 2 1 0 cmd2 cmd1 cmd0 0 0 0 w w w command bits these bits issue a command to control ieb communications. when the cmx flag in ieflg is set after the command issuance, the command is indicated to be in execution. when the cmx flag becomes 0, the operation state is entered. these bits are read as 0. the read value is undefined. do not use a bit manipulation instruction that causes malfunction. 000: no operation. operation is not affected. 001: unlock (required from other units) * 1 010: requires communications as the master 011: stops master communications * 2 100: undefined bits. operation is not affected by this command. 101: requires data transfer from the slave. 110: stops data transfer from the slave * 3 . 111: undefined bits. operation is not affected by this command. notes: 1. do not execute this command in slave communications. execute this command after slave communications ends or in master communications. if this command is issued in slave communications, this command is ignored. 2. this command is valid during master communications (mrq = 1). in other states, this command issuance is ignored. if this command is issued in master communications, the communications controller immediately enters the wait state. at this time, the issued master transmission request ends (mrq = 0). 3. this command is valid during slave communications (srq = 1). in other states, this command issuance is ignored. once this command was issued in slave transmission, the srq flag is 0 before slave transmission. therefore, a transmit request from the master is not responded. if a transmit request is issued during slave transmission, the transmission stops and the wait state is entered (srq = 0).
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 502 of 982 rej09b0054-0500 14.3.3 iebus master control register (iemcr) iemcr sets communications conditions for master communications (selection of broadcast or normal communications, retransmission counts at arbitration loss, and control bits value). it is not necessary to set this register for slave communications. bit bit name initial value r/w description 7 ss 1 r/w broadcast/normal communications select selects broadcast or normal communications for master communications. 0: broadcast communications 1: normal communications 6 5 4 rn2 rn1 rn0 0 0 0 r/w r/w r/w retransmission counts set the number of times retransmission is performed when arbitration is lost in master communications. if arbitration is lost for a specified number of times, the txe flag in ietsr and the al flag in ietef are set and transmission ends with a transmit error. if arbitration is won during retransmission, the retransmission count is automatically restored to the initial setting after master address transfer. 000: 0 001: 1 010: 2 011: 3 100: 4 101: 5 110: 6 111: 7
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 503 of 982 rej09b0054-0500 bit bit name initial value r/w description 3 2 1 0 ctl3 * 1 ctl2 ctl1 ctl0 0 0 0 0 r/w r/w r/w r/w control bits set the control bits in the control field for master transmission. 0000: reads slave status 0001: undefined. setting prohibited. 0010: undefined. setting prohibited. 0011: reads data and locks * 2 0100: reads locked address (lower 8 bits) 0101: reads locked address (upper 4 bits) 0110: reads slave status and unlocks * 2 0111: reads data 1000: undefined. setting prohibited. 1001: undefined. setting prohibited. 1010: writes command and locks * 2 1011: writes data and locks * 2 1100: undefined. setting prohibited. 1101: undefined. setting prohibited. 1110: writes command 1111: writes data notes: 1. ctl3 decides the data transfer direction of the message length bits in the message length field and data bits in the data field: ctl3 = 1: transfer is performed from master unit to slave unit ctl3 = 0: transfer is performed from slave unit to master unit 2. control bits to lock and unlock
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 504 of 982 rej09b0054-0500 14.3.4 iebus master unit address register 1 (iear1) iear1 sets the lower 4 bits of the master unit address and communications mode. in master communications, the master unit address becomes the master address field value. in slave communications, the master unit address is compared with the received slave address field. bit bit name initial value r/w description 7 6 5 4 iar3 iar2 iar1 iar0 0 0 0 0 r/w r/w r/w r/w lower 4 bits of iebus master unit address set the lower 4 bits of the master unit address. 3 2 imd1 imd0 0 0 r/w r/w iebus communications mode set iebus communications mode. 00: communications mode 0 01: communications mode 1 10: communications mode 2 11: setting prohibited 1 ? 0 ? reserved this bit is always read as 0 and cannot be modified. 0 ste 0 r/w slave transmission setting sets bit 4 in the slave status register. transmitting the slave status register informs the master unit that the slave transmission enabled state is entered by setting this bit to 1. note that this bit only sets the slave status register value and does not affect slave transmission directly. 0: bit 4 in the slave status register is 0 (slave transmission stop state) 1: bit 4 in the slave status register is 1 (slave transmission enabled state)
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 505 of 982 rej09b0054-0500 14.3.5 iebus master unit address register 2 (iear2) iear2 sets the upper 8 bits of the master unit address. in master communications, this register becomes the master address field value. in slave communications, this register is compared with the received slave address field. bit bit name initial value r/w description 7 6 5 4 3 2 1 0 iar11 iar10 iar9 iar8 iar7 iar6 iar5 iar4 0 0 0 0 0 0 0 0 r/w r/w r/w r/w r/w r/w r/w r/w upper 8 bits of iebus master unit address set the upper 8 bits of the master unit address. 14.3.6 iebus slave address setting register 1 (iesa1) iesa1 sets the lower 4 bits of the communications destination slave unit address. for slave communications, it is not necessary to set this register. bit bit name initial value r/w description 7 6 5 4 isa3 isa2 isa1 isa0 0 0 0 0 r/w r/w r/w r/w lower 4 bits of iebus slave address these bits set the lower 4 bits of the communications destination slave unit address 3 to 0 ? all 0 ? reserved these bits are always read as 0 and cannot be modified.
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 506 of 982 rej09b0054-0500 14.3.7 iebus slave address setting register 2 (iesa2) iesa2 sets the upper 8 bits of the communications destination slave unit address. for slave communications, it is not necessary to set this register. bit bit name initial value r/w description 7 6 5 4 3 2 1 0 isa11 isa10 isa9 isa8 isa7 isa6 isa5 isa4 0 0 0 0 0 0 0 0 r/w r/w r/w r/w r/w r/w r/w r/w upper 8 bits of iebus slave address set upper 8 bits of the communications destination slave unit address 14.3.8 iebus transmit message length register (ietbfl) ietbfl sets the message length for master or slave transmission. bit bit name initial value r/w description 7 6 5 4 3 2 1 0 tbfl7 tbfl6 tbfl5 tbfl4 tbfl3 tbfl2 tbfl1 tbfl0 0 0 0 0 0 0 0 0 r/w r/w r/w r/w r/w r/w r/w r/w transmit message length set the message length for master or slave transmission. if a value exceeding the maximum transmit bytes for one frame is set in ietbfl, communications are performed with two or more frames in some communications modes. in this case, in or after the second frame, the message length value should be the number of bytes of the remaining communications data, however, the initial ietbfl setting remains unchanged. therefore, for the second frame or after, re-set the number of bytes of the remaining communications data.
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 507 of 982 rej09b0054-0500 14.3.9 iebus transmit buffer register (ietbr) ietbr is a 1-byte buffer to which data to be transmitted in master or slave transmission is written. ietbr is empty when the txrdy flag in ietsr is 1. check the txrdy flag before setting transmit data in ietbr. data written in ietbr is transmitted in the data field in master or slave transmission. figure 14.6 shows the correspondence between the communications signal format and registers for iebus data transfer. bit bit name initial value r/w description 7 6 5 4 3 2 1 0 tbr7 tbr6 tbr5 tbr4 tbr3 tbr2 tbr1 tbr0 0 0 0 0 0 0 0 0 r/w r/w r/w r/w r/w r/w r/w r/w data to be transmitted is written to this 1-byte buffer. ietbfl [in master transmission] [in slave transmission] communications frame communications frame register register notes: 1. in slave transmission, the received master address is not saved. if the unit is locked, address comparison performed. 2. the received slave address is compared with iear1 and iear2, and if these addresses match, operation continues. 3. in slave transmission, the received control bits are not saved. the received control bits are decoded to decide the subsequent operation. ietbr message length bits data bits slave address master address control bits message length bits data bits slave address master address control bits iesa1, iesa2 iear1, iear2 ctl3 to ctl0 in iemcr ( * 1) ( * 3) ( * 2) iear1, iear2 ietbfl ietbr figure 14.6 transmission signal format and registers in data transfer
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 508 of 982 rej09b0054-0500 14.3.10 iebus reception master address register 1 (iema1) iema1 indicates the lower four bits of the communications destination master unit address in slave/broadcast reception. this register is enabled when slave/broadcast reception starts, and the contents are changed at the timing of setting the rxs flag in iersr. if a broadcast receive error interrupt is selected by the dee bit in iectr and the receive buffer is not in the receive enabled state on control field reception, a receive error interrupt is generated and the lower 4 bits of the master address are stored in iema1. this register cannot be modified. bit bit name initial value r/w description 7 6 5 4 ima3 ima2 ima1 ima0 0 0 0 0 r r r r lower 4 bits of iebus reception master address indicate the lower 4 bits of the communications destination master unit address in slave/broadcast reception. 3 to 0 ? all 0 r reserved these bits are always read as 0. 14.3.11 iebus reception master address register 2 (iema2) iema2 indicates the upper 8 bits of the communications destination master unit address in slave/broadcast reception. this register is enabled when slave/broadcast reception starts, and the contents are changed at the timing of setting the rxs flag in iersr. if a broadcast receive error interrupt is selected with the dee bit in iectr and the receive buffer is not in the receive enabled state at control field reception, a receive error interrupt is generated and the upper 8 bits of the master address are stored in iema2. this register cannot be modified by a write. bit bit name initial value r/w description 7 6 5 4 3 2 1 0 ima11 ima10 ima9 ima8 ima7 ima6 ima5 ima4 0 0 0 0 0 0 0 0 r r r r r r r r upper 8 bits of iebus reception master address indicate the upper 8 bits of the communications destination master unit address in slave/broadcast reception.
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 509 of 982 rej09b0054-0500 14.3.12 iebus receive control field register (ierctl) ierctl indicates the control field value in slave/broadcast reception. this register is enabled when slave/broadcast receive starts, and the contents are changed at the timing of setting the rxs flag in iersr. this register cannot be modified. bit bit name initial value r/w description 7 to 4 ? all 0 r reserved these bits are always read as 0. 3 2 1 0 rctl3 rctl2 rctl1 rctl0 0 0 0 0 r r r r iebus receive control field indicate the control field value in slave/broadcast reception. 14.3.13 iebus receive message length register (ierbfl) ierbfl indicates the message length field in slave/broadcast reception. this register is enabled when slave/broadcast receive starts, and the contents are changed at the timing of setting the rxs flag in iersr. this register cannot be modified. bit bit name initial value r/w description 7 6 5 4 3 2 1 0 rbfl7 rbfl6 rbfl5 rbfl4 rbfl3 rbfl2 rbfl1 rbfl0 0 0 0 0 0 0 0 0 r r r r r r r r iebus receive message length indicate the contents of message length field in slave/broadcast reception.
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 510 of 982 rej09b0054-0500 14.3.14 iebus receive buffer register (ierbr) ierbr is a 1-byte read-only buffer that stores data received in master or slave reception. this register can be read when the rxrdy flag in iersr is set to 1. this register indicates the data field value both in master and slave receptions. this register cannot be modified. figure 14.7 shows the relationship between transmission signal format and registers in iebus data reception. bit bit name initial value r/w description 7 6 5 4 3 2 1 0 rbr7 rbr6 rbr5 rbr4 rbr3 rbr2 rbr1 rbr0 0 0 0 0 0 0 0 0 r r r r r r r r one-byte read-only buffer that stores data received in master or slave reception iema1, iema2 iear1, iear2 ierctl ierbfl ierbr ( * ) iear1, iear2 iesa1, iesa2 ierbfl ierbr [in slave reception] [in master reception] communications frame communications frame register note: * received slave address is compared with iear1 and iear2. if they match, the following operations are performed. register settings message length bits data bits slave address master address control bits message length bits ctl3 to ctl0 in iemcr data bits slave address master address control bits figure 14.7 relationship between transmission signal format and registers in iebus data reception
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 511 of 982 rej09b0054-0500 14.3.15 iebus lock address register 1 (iela1) iela1 specifies the lower 8 bits of a locked address when a unit is locked. data in this register is valid when the lck flag in ieflg is set to 1. this register cannot be modified. bit bit name initial value r/w description 7 6 5 4 3 2 1 0 ila7 ila6 ila5 ila4 ila3 ila2 ila1 ila0 0 0 0 0 0 0 0 0 r r r r r r r r lower 8 bits of iebus lock address store the lower 8 bits of the master unit address when a unit is locked. 14.3.16 iebus lock address register 2 (iela2) iela2 is an 8-bit read-only register that specifies the upper 4 bits of a locked address when a unit is locked. data in this register is valid when the lck flag in ieflg is set to 1. this register cannot be modified. bit bit name initial value r/w description 7 to 4 ? all 0 r reserved these bits are always read as 0. 3 2 1 0 ila11 ila10 ila9 ila8 0 0 0 0 r r r r upper 4 bits of iebus locked address store the upper 4 bits of the master unit address when a unit is locked.
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 512 of 982 rej09b0054-0500 14.3.17 iebus general flag register (ieflg) ieflg indicates the ieb command execution status, lock status and slave address match, and broadcast reception detection. this register cannot be modified. bit bit name initial value r/w description 7 cmx 0 r command execution status indicates the command execution status. 1: a command is being executed [setting condition] when a master communications request or slave transmit request command is issued while the mrq, srq, or sre flag is set to 1 0: a command execution is completed [clearing condition] when a command execution has been completed 6 mrq 0 r master communications request indicates whether or not the unit is in communications request state as a master unit. 1: the unit is in communications request state as a master unit [setting condition] when the cmx flag is cleared to 0 after the master communications request command is issued 0: the unit is not in communications request status as a master unit [clearing condition] when the master communications have been completed
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 513 of 982 rej09b0054-0500 bit bit name initial value r/w description 5 srq 0 r slave transmission request indicates whether or not the unit is in transmit request status as a slave unit. 1: the unit is in transmit request status as a slave unit [setting condition] when the cmx flag is cleared to 0 after the slave transmit request command is issued. 0: the unit is not in transmit request status as a slave unit [clearing condition] when a slave transmission has been completed. 4 sre 0 r slave receive status indicates the execution status in slave/broadcast reception. 1: slave/broadcast reception is being executed [setting condition] when the slave/broadcast reception is started while the re bit in iectr is set to 1. 0: slave/broadcast reception is not being executed [clearing condition] when the slave/broadcast reception has been completed. 3 lck 0 r lock status indication set to 1 when a unit is locked by a lock request from the master unit. iela1 and iela2 values are valid only when this flag is set to 1. 1: a unit is locked [setting condition] when data for the number of bytes specified by the message length is not received after the control bits that make the unit locked are received from the master unit. (the lck flag is set to 1 only when the message length exceeds the maximum number of transfer bytes in one frame. this flag is not set by completion of other errors.) 0: a unit is unlocked [clearing condition] when an unlock condition is satisfied or when an unlock command is issued.
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 514 of 982 rej09b0054-0500 bit bit name initial value r/w description 2 ? 0rreserved this bit is always read as 0. 1 rss 0 r receive broadcast bit status indicates the received broadcast bit value. this flag is valid when the slave/broadcast reception is started. (this flag is changed at the timing of setting the rxs flag in iersr.) the previous value remains unchanged until the next slave/broadcast reception is started. 0 gg 0 r general broadcast reception acknowledgement set to 1 when the slave address is acknowledged as h ' fff in broadcast reception. as well as the receive broadcast bit, this flag is valid when the slave/broadcast reception is started. (this flag is changed at the timing of setting the rxs flag in iersr.) the previous value remains unchanged until the next slave/broadcast reception is started. this flag is cleared to 0 in slave normal reception. [setting condition] when h ' fff is acknowledged in the slave field in broadcast reception [clearing conditions] ? a unit is in slave reception ? when h ' fff is not acknowledged in slave field in broadcast reception
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 515 of 982 rej09b0054-0500 14.3.18 iebus transmit/runaway status register (ietsr) ietsr detects transmit data ready, transmit start, transmit normal completion, transmit completion with an error, or runaway states. each status flags in ietsr corresponds to a bit in the iebus transmit/runaway interrupt enable register (ieiet) that enables or disables each interrupt. bit bit name initial value r/w description 7 txrdy 1 r/w transmit data ready indicates that the next data can be written to ietbr since ietbr is empty. this flag is automatically cleared by dtc * data transfer. when data is transmitted by the cpu, this flag must be cleared by software. this flag is cleared by writing 0 after reading a 1 from this flag. [setting conditions] ? immediately after reset ? when data can be written to ietbr (: when ieb has loaded data from ietbr to the transmit shift register) [clearing conditions] ? when writing 0 after reading txrdy = 1 ? when data is written to tbr by the dtc by a txrdy request. note: this flag is not cleared on the end byte of dtc transfer. 6 to 4 ? all 0 ? reserved these bits are always read as 0 and cannot be modified. 3 ira 0 r/w iebus runaway state indicates that the on-chip microprogram for iebus control is in the runaway states. this flag is set to 1 when a runaway occurs during either iebus transmission or reception. (this flag is not a transfer specific flag and is also set for a reception runaway.) [setting condition] when the on-chip microprogram is in the runaway states [clearing condition] when writing 0 after reading ira = 1
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 516 of 982 rej09b0054-0500 bit bit name initial value r/w description 2 txs 0 r/w transmit start detection indicates that the ieb starts transmission. [setting conditions] ? master transmission: when the arbitration is won and when the master address field transmission is completed ? slave transmission: when the control bits of h ' 3 (0011) or h ' 7 (0111) is received from the master unit meaning that data transfer is requested [clearing condition] when writing 0 after reading txs = 1 1 txf 0 r/w transmit normal completion indicates that data for the number of bytes specified by the message length bits has been transmitted with no error. [setting condition] when data for the number of bytes specified by the message length bits has been transmitted normally [clearing condition] when writing 0 after reading txf = 1
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 517 of 982 rej09b0054-0500 bit bit name initial value r/w description 0 txe 0 r/w transmit error completion indicates that data for the number of bytes specified by the message length bits is not completed and that the data transmission is terminated. the source of this error can be checked by the contents of ietef. this flag is set at the timing that an error indicated by ietef occurs. the txe flag can be cleared even when the error source flag in ietef is set to 1 because the txe flag is not logically ored with the flags in ietef. in master reception, an error (arbitration loss, timing error, or nak reception) generated after a master communications command is issued before master reception starts will be detected as a transmit error. [setting condition] when the data for the number of bytes specified by the message length bits is not completed and when the transmission is terminated [clearing condition] when writing 0 after reading txe = 1
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 518 of 982 rej09b0054-0500 14.3.19 iebus transmit/runaway interrupt enable register (ieiet) ieiet enables/disables ietsr transmit ready, transmit start, transmit normal completion, transmit completion with an error, and runaway interrupts. bit bit name initial value r/w description 7 txrdye 0 r/w transmit data ready interrupt enable enables/disables a transmit data ready interrupt. 0: disables a transmit data ready (txrdy) interrupt 1: enables a transmit data ready (txrdy) interrupt 6 to 4 ? all 0 ? reserved these bits are always read as 0 and cannot be modified. 3 irae 0 r/w iebus runaway state interrupt enable enables/disables an iebus runaway state interrupt. 0: disables an iebus runaway state interrupt (ira) 1: enables an iebus runaway state interrupt (ira) 2 txse 0 r/w transmit start interrupt enable enables/disables a transmit start (txs) interrupt. 0: disables a transmit start (txs) interrupt 1: enables a transmit start (txs) interrupt 1 txfe 0 r/w transmit normal completion interrupt enable enables/disables a transmit normal completion (txf) interrupt. 0: disables a transmit normal completion (txf) interrupt 1: enables a transmit normal completion (txf) interrupt 0 txee 0 r/w transmit error termination interrupt enable enables/disables a transmit error termination (txe) interrupt. 0: disables a transmit error termination (txe) interrupt 1: enables a transmit error termination (txe) interrupt
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 519 of 982 rej09b0054-0500 14.3.20 iebus transmit error flag register (ietef) ietef checks the source of a txe interrupt indicated in ietsr. this register detects an overflow of a maximum number of bytes in one frame, arbitration loss, underrun error, timing error, and nak reception. bit bit name initial value r/w description 7 to 5 ? all 0 ? reserved these bits are always read as 0 and cannot be modified. 4 al 0 r/w arbitration loss the ieb retransmits from the start bit for the number of times specified by bits rn2 to rn0 in iemcr if the arbitration has been lost in master communications. if the arbitration has been lost for the specified number of times, the al and txe flags are set to enter the wait state. if the arbitration has been won within retransmit for the specified number of times, this flag is not set to 1. this flag is set only when the arbitration has been lost and the wait state is entered. [setting condition] when the arbitration has been lost during data transmission and the transmission has been terminated [clearing condition] when writing 0 after reading al = 1 3 ue 0 r/w underrun error indicates that an underrun error has occurred during data transmission. the ieb detects an underrun error occurrence when the ieb fetches data from ietbr while the txrdy flag is set to 1, and the ieb sets the txe flag and enters the wait state. accordingly, when the txrdy flag is not cleared even if data is written to ietbr, an underrun error occurs and data transmission is terminated. note that the txrdy flag must be cleared in data transmission by the cpu. [setting condition] when the ieb loads data from ietbr to the transmit shift register while the txrdy flag is set to 1 [clearing condition] when writing 0 after reading ue = 1
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 520 of 982 rej09b0054-0500 bit bit name initial value r/w description 2 ttme 0 r/w timing error set to 1 if data is not transmitted at the timing specified by the iebus protocol during data transmission. the ieb sets the txe flag and enters the wait state. [setting condition] when a timing error occurs during data transmission [clearing condition] when writing 0 after reading ttme = 1 1 ro 0 r/w overflow of maximum number of transmit bytes in one frame indicates that the maximum number of bytes defined by communications mode have been transmitted because a nak has been received from the receive unit and retransmit has been performed, or that transmission has not been completed because the message length value exceeds the maximum number of transmit bytes in one frame. the ieb sets the txe flag and enters the wait state. [setting condition] when the transmit has not been completed although the maximum number of bytes defined by communications mode have been transmitted [clearing condition] when writing 0 after reading ro = 1
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 521 of 982 rej09b0054-0500 bit bit name initial value r/w description 0 ack 0 r/w acknowledge bit status indicates the data received in the acknowledge bit of the data field. ? acknowledge bit other than in the data field the ieb terminates the transmission and enters the wait state if a nak is received. in this case, this bit and the txe flag are set to 1. ? acknowledge bit in the data field the ieb retransmits data up to the maximum number of bytes defined by communications mode until an ack is received from the receive unit if a nak is received from the receive unit during data field transmission. in this case, when an ack is received from the receive unit during retransmission, this flag is not set and transmission will be continued. when transmission is terminated without receiving an ack, this flag is set to 1. note: this flag is invalid in broadcast communications. [setting condition] when the acknowledge bit of 1 (nak) is detected [clearing condition] when writing 0 after reading ack = 1
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 522 of 982 rej09b0054-0500 14.3.21 iebus receive status register (iersr) iersr detects receive data ready, receive start, transmit/receive normal completion, or receive completion with an error. each status flag in iersr corresponds to a bit in the ieier that enables/disables each interrupt. bit bit name initial value r/w description 7 rxrdy 1 r/w receive data ready indicates that the receive data is stored in ierbr and that the receive data can be read. this flag is automatically cleared by dtc * data transfer. when data is transmitted by the cpu, this flag must be cleared by software. [setting condition] when data reception has been completed normally and receive data has been loaded to ierbr. [clearing conditions] ? when writing 0 after reading rxrdy = 1 ? when ierbr data is read by the dtc by a rxrdy request. note: this flag cannot be cleared on the end byte of the dtc transfer. 6 to 3 ? all 0 ? reserved these bits are always read as 0 and cannot be modified. 2 rxs 0 r/w receive start detection indicates that the ieb starts reception. [setting conditions] ? master reception: when the message length field has been received from the slave unit correctly after the arbitration is won and the control field transmission is completed ? slave reception: when the message length field has been received from the master unit correctly [clearing condition] when writing 0 after reading rxs = 1
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 523 of 982 rej09b0054-0500 bit bit name initial value r/w description 1 rxf 0 r/w receive normal completion indicates that data for the number of bytes specified by the message length bits has been received and with no error. [setting condition] when data for the number of bytes specified by the message length bits has been received normally. [clearing condition] when writing 0 after reading rxf = 1 0 rxe 0 r/w receive error completion indicates that data for the number of bytes specified by the message length bits is not completed and that the data reception is terminated. the source of this error can be checked by the contents of ieref. this flag is set at the timing that an error indicated by ieref occurs. the rxe flag can be cleared even when the error source flag in ieref is set to 1 because the rxe flag is not logically ored with the flags in ieref. [setting condition] when the data for the number of bytes specified by the message length bits is not completed and when the reception is terminated. [clearing condition] when writing 0 after reading rxe = 1
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 524 of 982 rej09b0054-0500 14.3.22 iebus receive interrupt enable register (ieier) ieier enables/disables iersr reception ready, receive start, transmit/receive normal completion, and receive completion with an error interrupts. bit bit name initial value r/w description 7 rxrdye 0 r/w receive data ready interrupt enable enables/disables a receive data ready interrupt. 0: disables a receive data ready (rxrdy) interrupt 1: enables a receive data ready (rxrdy) interrupt 6 to 3 ? all 0 ? reserved these bits are always read as 0 and cannot be modified. 2 rxse 0 r/w receive start interrupt enable enables/disables a receive start (rxs) interrupt. 0: disables a receive start (rxs) interrupt 1: enables a receive start (rxs) interrupt 1 rxfe 0 r/w receive normal completion enable enables or disables a receive normal completion (rxf) interrupt. 0: disables a receive normal completion (rxf) interrupt 1: enables a receive normal completion (rxf) interrupt 0 rxee 0 r/w receive error termination interrupt enable enables or disables a receive error termination (rxe) interrupt. 0: disables a receive error termination (rxe) interrupt 1: enables a receive error termination (rxe) interrupt 14.3.23 iebus receive error flag register (ieref) ieref checks the source of an rxe interrupt indicated in iersr. this register detects an overrun error, timing error, overflow of a maximum number of bytes in one frame, and parity error. these flags become valid when the receive start flag (rxs) is set to 1. if an error occurs before the rxs flag is set to 1, the ieb terminates the communications and enters the wait state. in this case, these flags will not be set and the rxe flag is not set.
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 525 of 982 rej09b0054-0500 bit bit name initial value r/w description 7 to 4 ? all 0 ? reserved these bits are always read as 0 and cannot be modified. 3 ove 0 r/w overrun control flag used to control the overrun during data reception. the ieb sets the ove and rxe flags when the ieb receives the next byte data while the receive data has not been read (the rxrdy flag is not cleared) and when the parity bit reception has been started. if this flag remains set until acknowledge bit transfer, the ieb assumes that an overrun error has occurred and returns a nak to the communications destination unit. the communications destination unit retransmits data up to the maximum number of transmit bytes. the ieb, however, returns a nak when this flag remains set because the ieb assumes that the overrun error has not been cleared. if this flag is cleared to 0, the ieb decides that the overrun error has been cleared, returns an ack, and receives the next data. in broadcast reception, if this flag is set during acknowledge bit transmission, the ieb immediately enters the wait state. [setting condition] when the next byte data is received while the rxrdy flag is not cleared and when the parity bit of the data is received. [clearing condition] when writing 0 after reading ove = 1 2 rtme 0 r/w timing error set to 1 if data is not received at the timing specified by the iebus protocol during data reception. the ieb sets the rxe flag and enters the wait state. [setting condition] when a timing error occurs during data reception [clearing condition] when writing 0 after reading rtme = 1
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 526 of 982 rej09b0054-0500 bit bit name initial value r/w description 1 dle 0 r/w overflow of maximum number of receive bytes in one frame indicates that the maximum number of bytes defined by communications mode have been received because a parity error or overrun error occurred, or that the reception has not be completed because the message length value exceeds the maximum number of receive bytes in one frame. the ieb sets the rxe flag and enters the wait state. [setting condition] when the reception has not been completed although the maximum number of bytes defined by communications mode have been received. [clearing condition] when writing 0 after reading dle = 1 0 pe 0 r/w parity error indicates that a parity error has occurred during data field reception. if a parity error occurs before data field reception, the ieb immediately enters the wait state and the pe flag is not set. if a parity error occurs when the maximum number of receive bytes in one frame has not been received, the pe flag is not set. when a parity error occurs, the ieb returns a nak to the communications destination unit via the acknowledge bit. in this case, the communications destination unit continues retransfer up to the maximum number of receive bytes in one frame and if the reception has been completed normally by clearing the parity error, the pe flag is not set. if the parity error is not cleared when the reception is terminated before receiving data for the number of bytes specified by the message length, the pe flag is set. in broadcast reception, if a parity error occurs during data field reception, the ieb enters the wait state immediately after setting the pe flag. [setting condition] when the parity bit of last data of the data field is not correct after the maximum number of receive bytes has been received [clearing condition] when writing 0 after reading pe = 1
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 527 of 982 rej09b0054-0500 14.4 operation descriptions 14.4.1 master transmit operation this section describes an example of master transmission using the dtc after slave reception. (1) ieb initialization (a) setting the iebus control register (iectr) enable the iebus pins, select the signal polarity, and select a clock supplied to the ieb. clear the luee bit to 0 since the transfer is performed by the dtc. (b) setting the iebus master unit address registers 1 and 2 (iear1 and iear2) specify the master unit address and specify the communications mode in iear1. (c) setting the iebus slave address setting registers 1 and 2 (iesa1 and iesa2) specify the communications destination slave unit address. (d) setting the iebus master control register (iemcr) select broadcast/normal communications, specify the number of retransfer counts at arbitration loss, and specify the control bits. (e) setting the iebus transmit message length register (ietbfl) specify the message length bits. (f) setting the iebus transmit/runaway interrupt enable register (ieiet) enable txrdy (ietxi), txs, txf, and txe (ietsi) interrupts. the above registers can be specified in any order. (the register specification order does not affect the ieb operation.) (2) dtc initialization 1. set the start address of the ram which stores the register information necessary for the dtc transfer in the vector address (h'000004d4) to be accessed when a dtc transfer request is generated. 2. set the following data from the start address of the ram. ? transfer source address (sar): start address of the ram which stores data to be transmitted in the data field. ? transfer destination address (dar): address (h'fff808) of the iebus transmit buffer register (ietbr) ? transfer count (cra): the same value as the ietbfl contents 3. set dtceg5 in the dtc enable register g (dtcerg) to enable the txrdy interrupt (ietxi).
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 528 of 982 rej09b0054-0500 because the txrdy flag is retained after a reset, the dtc transfer starts when the ietxi is enabled and the first data for the data field is written to ietbr. the dtc negates the txrdy flag and the first byte of dtc transfer is completed. (3) master transmission flow figure 14.8 shows the master transmission flow. numbers in the following description correspond to the number in figure 14.8. 1. after the ieb and dtc have been initialized, a master communications request command is issued from iecmr. during slave reception, the command execution status flag (cmx) in ieflg is set and the master communications request will not be issued. 2. when the slave reception has been completed, the cmx flag is cleared, the master communications command is executed, and the mrq flag is set. 3. the transmit start detection flag (txs) in ietsr is set when arbitration is won and the master address has been transmitted. in this case, one of the transmit status interrupts (ietsi) is requested to the cpu, and the txs flag is cleared in the interrupt handling routine. 4. the ieb loads data to be transmitted in the data field from ietbr when the control and message length fields have been transmitted and an ack is received in each field. after that, the txrdy flag is set. a dtc transfer request is generated by ietxi and the second byte is written to the transmit buffer. 5. similarly, the data field load and transmission are repeated. 6. the dtc completes the data transfer for the number of specified bytes when data to be transmitted in the last byte is written to. at this time, the dtc does not clear the txrdy flag. it, however, clears bit dtceg5 in the dtc enable register g (dtcerg) so as not to generate more dtc transfer request. 7. a txrdy interrupt (ietxi) is issued to the cpu when the dtc transfer is completed. in this interrupt handling routine, the txrdy flag can be cleared. however, since a txrdy interrupt will be generated again after the last byte transfer, the txrdy flag remains set. (note that the luee bit must be cleared to 0 because an underrun error occurs to terminate the transfer if the luee bit in iectr is set to 1.) note, however, that the txrdy interrupt must be disabled because the txrdy interrupt is always generated. 8. a transmit normal completion (txf) interrupt (ietsi) occurs after the last data transfer is completed. in this case, the cpu clears the txf flag and completes the normal completion interrupt and clears the mrq flag to 0. note: as a transmit status interrupt (ietsi), the transmit error termination (txe) interrupt as well as the transfer start detection (txs) and transmit normal completion (txf) interrupts must be enabled. if an error termination interrupt is disabled, no interrupt is generated even if the transmission is terminated by an error.
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 529 of 982 rej09b0054-0500 dn h ma sa cf lf lf d1 d2 dn-1 dn-1 dn iecmr slave reception master transmission h: header, ma: master address field, sa: slave address field, cf: control field, lf: message length field, d1, d2,..., dn-1, dn: data field cmx mrq srq sre txrdy txs txf ietxi (txrdy) (to dtc) ietxi (txrdy) (to cpu) ietsi (to cpu) ieflg ietsr interrupt (1) (2) (2) (7) (8) (8) (3) (3) (4) (5) (6) (4) (5) (6) cleared to 0 byt dtc transfer of 1st byte master transmission request dtc transfer of 2nd byte dtc transfer of 3rd byte dtc transfer of nth byte figure 14.8 master transmit operation timing 14.4.2 slave receive operation this section describes an example of performing a slave reception using the dtc. (1) ieb initialization (a) setting the iebus control register (iectr) enable the iebus pins, select the signal polarity, and select a clock supplied to the ieb. set the re bit to 1 to perform reception. the luee bit does not need to be specified. (b) setting the iebus master unit address registers 1 and 2 (iear1 and iear2) specify the master unit address and specify the communications mode in iear1. compare with the slave address in the communications frame and receive the frame if matched. (c) setting the iebus receive interrupt enable register (ieier) enable rxrdy (ierxi), rxs, and rxe (iersi) interrupts.
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 530 of 982 rej09b0054-0500 the above registers can be specified in any order. (the register specification order does not affect the ieb operation.) (2) dtc initialization 1. set the start address of the ram which stores the register information necessary for the dtc transfer in the vector address (h'000004d2) to be accessed when a dtc transfer request is generated. 2. specify the following from the start address of the ram. ? transfer source address (sar): address (h'fff80d) of the iebus receive buffer register (ierbr). ? transfer destination address (dar): start address of the ram which stores data received from the data field. ? transfer count (cra): maximum number of transfer bytes in one frame in the transfer mode. 3. set dtceg6 in the dtc enabler register g (dtcerg) to enable the rxrdy interrupt (ietxi). because the above settings are performed before the frame reception, the length of data to be received cannot be decided. accordingly, the maximum number of transfer bytes in one frame is specified as the dtc transfer count. if the dtc is specified after reception starts, the above settings are performed in the receive start (rxs) interrupt handling routine. in this case, the transfer count must be the same value as the contents of the iebus receive message length register (ierbfl). (3) slave reception flow figure 14.9 shows the slave reception flow. numbers in the following description correspond to the number in figure 14.9. in this example, the dtc is specified when the frame reception starts. 1. after the broadcast reception has been completed, the slave reception is performed. the receive broadcast bit status flag (rss) in ieflg retains the previous frame information (set to 1) until the receive start detection flag (rxs) is set to 1. if the rss flag changes at the timing of header reception, the interrupt handling of the broadcast reception completion must be completed before the header reception. accordingly, the rss flag is stipulated that it changes at the timing of starting reception. 2. if data is received up to the message length field, a receive start detection (rxs) interrupt (receive status interrupt (iersi)) will occur and the sre flag is set to 1. in this case, the dtc initialization described in (2) is performed. after initialization, the rxs flag is cleared to 0.
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 531 of 982 rej09b0054-0500 3. when the first data is received, the rxrdy flag is set to 1. a dtc transfer request by ierxi occurs, and the dtc loads data from the iebus receive buffer register (ierbr) and clears the rxrdy flag. 4. similarly, the data field reception and load are repeated. 5. when the last data is received, the dtc completes the data transfer for the specified number of bytes after loading the receive data to the ram. in this case, the dtc does not clear the rxrdy flag. it, however, clears the dtc enable register g (dtceg). accordingly, hereafter, no transfer request will be issued to the dtc. 6. when the dtc transfer has been completed, an rxrdy interrupt (ierxi) is issued to the cpu. in this interrupt handling routine, the rxrdy flag is cleared. 7. when the last data is received, a receive normal completion (rxf) interrupt (iersi) occurs. in this case, the cpu clears the rxf flag in order to complete the normal completion interrupt. the sre flag is cleared to 0. notes: 1. as a receive status interrupt (iersi), the receive error termination (rxe) interrupt as well as the receive start detection (rxs) and receive normal completion (rxf) interrupts must be enabled. if an error termination interrupt is disabled, no interrupt is generated even if the reception is terminated by an error. 2. the interrupt occurs after the dtc transfer has been completed. accordingly, the interrupt described in item 6 actually occurs after item 7 above.
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 532 of 982 rej09b0054-0500 dn h ma sa cf lf d1 d2 dn-1 dn iectr re rss cmx mrq srq sre rxrdy rxs rxf ierxi (rxrdy) (to dtc) ierxi (rxrdy) (to cpu) iersi (to cpu) ieflg ieflg iersr interrupt (1) (2) (2) (7) (7) (7) (3) (4) (3) (4) (5) (5) (6) broadcast reception slave reception h: header, ma: master address field, sa: slave address field, cf: control field, lf: message length field, d1, d2,..., dn-1, dn: data field dtc transfer of 1st byte dtc transfer of (n-2)th byte dtc transfer of (n-1)th byte dtc transfer of nth byte figure 14.9 slave reception operation timing (4) when an error occurs in broadcast reception (dee = 1) figure 14.10 shows an example in which a receive error occurs because the receive preparation cannot be completed (the rxrdy flag is not cleared) until the control field is received in broadcast reception after the slave reception while the dee bit is set to 1. note: the same as the case in which the re bit is not set before the control field reception.
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 533 of 982 rej09b0054-0500 dn h ma sa cf lf d1 d2 dn-1 dn iectr rss re, dee cmx mrq srq sre rxrdy rxs rxf rxe iema1 iema2 ieflg ieflg iersr slave reception broadcast reception h: header, ma: master address field, sa: slave address field, cf: control field, lf: message length field, d1, d2,..., dn-1, dn: data field broadcast reception is performed while the dee bit is set to 1. the rxrdy flag has not been cleared when the control field is received. set the rxe flag and the master unit address in iema1 and iema2. lower 4 bits of the master address upper 8 bits of the master address figure 14.10 error occurrence in the broadcast reception (dee = 1) 14.4.3 master reception this section shows an example of performing a master reception using the dtc after slave reception. (1) ieb initialization (a) setting the iebus control register (iectr) enable the iebus pins, select the signal polarity, and select a clock supplied to the ieb. set the re bit to 1 to perform reception. the luee bit does not need to be specified. (b) setting the iebus master unit address registers 1 and 2 (iear1 and iear2) specify the master unit address and specify the communications mode in iear1. compare with the slave address in the communications frame and receive the frame if matched.
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 534 of 982 rej09b0054-0500 (c) setting the iebus slave address setting registers 1 and 2 (iesa1 and iesa2) specify the communications destination slave unit address. (d) setting the iebus master control register (iemcr) select broadcast/normal communications, specify the number of retransfer counts at arbitration loss, and specify the control bits. (e) setting the iebus receive interrupt enable register (ieier) enable the rxrdy (ierxi), rxs, rxf, and rxe (iersi) interrupts. the above registers can be specified in any order. (the register specification order does not affect the ieb operation.) (2) dtc initialization 1. set the start address of the ram which stores the register information necessary for the dtc transfer in the vector address (h'000004d2) to be accessed when a dtc transfer request is generated. 2. set the following data from the start address of the ram. ? transfer source address (sar): address (h'fff80d) of the iebus receive buffer register (ierbr). ? transfer destination address (dar): start address of the ram which stores data to be received from the data field. ? transfer count (cra): maximum number of transfer bytes in one frame in the transfer mode. 3. set bit dtceg6 in the dtc enabler register g (dtcerg), and enable the rxrdy interrupt (ierxi). because the above settings are performed before frame reception, the length of data to be received cannot be determined. accordingly, the maximum number of transfer bytes in one frame is specified as the dtc transfer count. if the dtc is specified after reception starts, the above settings are performed in the receive start detection (rxs) interrupt handling routine. in this case, the transfer count must be the same value as the contents of the iebus receive message length register (ierbfl).
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 535 of 982 rej09b0054-0500 (3) master reception flow figure 14.11 shows the master reception flow. numbers in the following description correspond to the number in figure 14.11. in this example, the dtc is specified when the frame reception starts. 1. after the ieb has been initialized, a master communications request command is issued from iecmr. during slave reception, the command execution status flag (cmx) in ieflg is set and the master communications request will not be issued. 2. the cmx flag is cleared when the slave reception is completed, the master communications command is executed, and the mrq flag is set. 3. if the arbitration is won, the master address, slave address, and control field will be transmitted. an error generated before the control field transmission will be handled as a transmission error. in this case, the txe flag is set and the error contents will be reflected in ietef. 4. the message length field is received from the slave unit. if no parity error is detected and reception is performed correctly, the receive start detection flag (rxs) is set to 1. if a parity error occurs, it is handled as a receive error. a receive start detection (rxs) interrupt (receive status interrupt (iersi)) occurs and the dtc initialization described in (2) is performed. after dtc initialization, the rxs flag is cleared to 0. 5. when the first data is received, the rxrdy flag is set to 1. a dtc transfer request by ierxi occurs and the dtc loads data from the iebus receive buffer register (ierbr) and clears the rxrdy flag. 6. similarly, the above data field receive and load operations are repeated. 7. when the last data is received, the dtc completes the data transfer for the specified number of bytes after loading the receive data to the ram. in this case, the dtc does not clear the rxrdy flag. it, however, clears the dtc enable register g (dtceg). accordingly, hereafter, no transfer request will be issued to the dtc. 8. when the dtc transfer has been completed, an rxrdy interrupt (ierxi) is issued to the cpu. in this interrupt handling routine, the rxrdy flag is cleared. 9. when the last data is received, a receive normal completion (rxf) interrupt (iersi) occurs. in this case, the cpu clears the rxf flag to complete the receive normal completion interrupt. the mrq flag is cleared to 0. notes: 1. as a receive status interrupt (iersi), an receive error completion (rxe) interrupt as well as the receive start detection (rxs) and receive normal completion (rxf) interrupts must be enabled. if a receive error completion interrupt is disabled, no interrupt is generated even if the reception is terminated by an error. 2. the interrupt occurs after the dtc transfer has been completed. accordingly, the interrupt described in item 8 actually occurs after item 9 above.
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 536 of 982 rej09b0054-0500 dn h ma sa cf lf d1 d2 dn-1 dn iectr re cmx mrq srq sre rxrdy rxs rxf ierxi (rxrdy) (to dtc) ierxi (rxrdy) (to cpu) iersi (to cpu) iecmr ieflg iersr interrupt (1) (2) (2) (3) (4) (4) (9) (5) (6) (7) (5) (6) (7) (8) (9) (9) slave reception master reception h: header, ma: master address field, sa: slave address field, cf: control field, lf: message length field, d1, d2,..., dn-1, dn: data field dtc transfer of 1st byte master reception request dtc transfer of (n-2)th byte dtc transfer of (n-1)th byte dtc transfer of nth byte figure 14.11 master receive operation timing 14.4.4 slave transmission this section shows an example of performing a slave transmission using the dtc after slave reception. (1) ieb initialization (a) setting the iebus control register (iectr) enable the iebus pins, select the signal polarity, and select a clock supplied to the ieb. clear the luee bit to 0 because transfer by the dtc is performed. (b) setting the iebus master unit address registers 1 and 2 (iear1 and iear2) specify the master unit address and specify the communications mode in iear1. compare with the slave address in the communications frame and receive the frame if matched.
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 537 of 982 rej09b0054-0500 (c) setting the iebus transmit message length register (ietbfl) specify the message length bits. (d) setting the iebus transmit/runaway interrupt enable register (ieiet) enable the txrdy (ietxi), txs, and txe (ietsi) interrupts. the above registers can be specified in any order. (the register specification order does not affect the ieb operation.) (2) dtc initialization 1. set the start address of the ram which stores the register information necessary for the dtc transfer in the vector address (h'000004d4) to be accessed a dtc transfer request is generated. 2. set the following data from the start address of the ram. ? transfer source address (sar): start address of the ram which stores data to be transmitted from the data field. ? transfer destination address (dar): address (h'fff808) of the iebus transmit buffer register (ietbr) ? transfer count (cra): the same value as ietbfl 3. set bit dtceg5 in the dtc enabler register g (dtcerg), and enable the txrdy interrupt (ietxi). because the txrdy flag is retained after reset, the dtc transfer is executed when the ietxi is enabled and the first data field data is written to ietbr. the dtc negates the txrdy flag and the dtc transfer of the first byte is completed. (3) slave transmission flow figure 14.12 shows the slave transmission flow. numbers in the following description correspond to the numbers in figure 14.12. 1. after the ieb and dtc have been initialized, a slave communications request command is issued from iecmr. during slave reception, the command execution status flag (cmx) in ieflg is set and the slave communications request will not be issued. 2. the cmx flag is cleared when the slave reception is completed, the slave communications command is executed, and the srq flag is set. 3. if data up to the control field has been received correctly and if the contents of the control bits is h'3 or h'7, the transmit start detection flag (txs) in ietsr register is set to 1. in this case, the txs flag is cleared in the txs interrupt handling routine. 4. the slave then transmits the message length field, and the ieb loads the transmit data in the data field from ietbr when the ack is received. then the txrdy flag is set to 1. a dtc
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 538 of 982 rej09b0054-0500 transfer request by ietxi is generated and the second byte data is written to the transmit buffer. 5. similarly, the above data field load and transmission operations are repeated. 6. the dtc completes the data transfer for the number of specified bytes when data to be transmitted in the last byte is written to. at this time, the dtc does not clear the txrdy flag. it, however, clears bit dtceg5 in the dtc enable register g (dtcerg) not to generate more dtc transfer request. 7. a txrdy interrupt (ietxi) is issued to the cpu when the dtc transfer is completed. in this interrupt handling routine, the txrdy flag can be cleared. however, since the txrdy interrupt will be generated again after the last byte transfer, the txrdy flag remains set. (note that the luee bit should be cleared to 0 because an underrun error occurs to terminate the transfer if the luee bit in iectr is set to 1.) note, however, that the txrdy interrupt should be disabled because the txrdy interrupt is always generated. 8. after the last data transfer has been completed, a transmit normal completion (txf) interrupt occurs. in this case, the cpu clears the txf flag and completes the normal completion interrupt and clears the srq flag to 0. notes: 1. as a transmit status interrupt (ietsi), a transmit error termination (txe) interrupt as well as the transmit start detection (txs) and transmit normal completion (txf) interrupts must be enabled. if a transmit error completion interrupt is disabled, no interrupt is generated even if the transfer is terminated by an error. 2. if the control bits sent from the master unit is h'0, h'4, h'5, or h'6 in slave transmission, the ieb automatically performs processing and the txs and txf flags are not set.
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 539 of 982 rej09b0054-0500 dn h ma sa cf lf d1 d2 dn-1 dn-1 lf dn iecmr cmx mrq srq sre txrdy txs txf ietxi (txrdy) (to dtc) ietxi (txrdy) (to cpu) ietsi (to cpu) ieflg ietsr interrupt (1) (2) (2) (3) (3) (7) (8) (8) (8) (4) (5) (6) (4) (5) (6) slave reception slave transmission h: header, ma: master address field, sa: slave address field, cf: control field, lf: message length field, d1, d2,..., dn-1, dn: data field dtc transfer of 2nd byte dtc transfer of 3rd byte dtc transfer of nth byte cleared to 0 byt dtc transfer of 1st byte slave transmission request figure 14.12 slave transmit operation timing
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 540 of 982 rej09b0054-0500 14.5 interrupt sources figures 14.13 and 14.14 show the transmit and receive interrupt sources, respectively. dtc ietxi (txrdy interrupt) note: * the txe flag is set at the timing when an error source of ietef occurs. the txe flag can be cleared even when the error source flag in ietef is set to 1 because the txe flag is not logically ored with flags in ietef. ietsr ietsi (transmit status interrupt) txrdy ira irae txse ietef al ue ttme ro ack txfe txee txs txf ( * ) txe txrdye ieiet cpu figure 14.13 relationships among transfer interrupt sources dtc iersr iersi (transmit status interrupt) ierxi (rxrdy interrupt) rxrdy rxse ieref ove rtme dle pe rxfe rxee rxs rxf ( * ) rxe rxrdye ieier cpu note: * the rxe flag is set at the timing when an error source of ieref occurs. the rxe flag can be cleared even when the error source flag in ieref is set to 1 because the rxe flag is not logically ored with flags in ieref. figure 14.14 relationships among receive interrupt sources
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 541 of 982 rej09b0054-0500 14.6 usage notes 14.6.1 setting module stop mode the ieb is enabled or disabled by setting the module stop control register. in the initial state, the ieb is disabled. after the module stop mode is canceled, registers can be accessed. for details, see section 24, power-down modes. 14.6.2 txrdy flag and underrun error 1. the txrdy flag indicates that ietbr is empty. writing to ietbr by the dtc clears the txrdy flag. meanwhile, the txrdy flag must be cleared by software since writing to ietbr by the cpu does not clear the txrdy flag. 2. if the cpu fails to write to ietbr by the timing of the frame transmission or if the number of transfer words is less than the length specified by the message length bits, an underrun error occurs. 3. the ieb decides that an underrun error occurred when the data is loaded from ietbr to the transmit shift register while the txrdy flag is set to 1. in this case, the ieb sets the txe flag in ietsr and enters the wait state. the ue flag in ietef is also set to 1. 4. on the receive side, the unit decides that a timing error has occurred because the communications are terminated. 5. in data transfer using the dtc, the txrdy flag in ietsr is not cleared after the last byte data is transferred to ietbr and a cpu interrupt caused by the dtc interrupt will occur. if the txrdy flag is not cleared in this cpu interrupt handling routine, an underrun error will occur when the last byte data is loaded from ietbr to the transmit shift register. in this case, if the luee bit is cleared to 0 (initial value), no underrun error occurs and the last byte of the data field is transmitted correctly. (if the luee bit is set to 1, an underrun error occurs.) 6. although the dtc is used as described in item 5, if the number of dtc transfer words is less than the length specified by the message length bits, the luee bit setting is invalid. (the luee bit is valid only when data is transmitted for the number of bytes specified by the message length bits has been transmitted.) in this case, an underrun error occurs, data is transmitted for one byte less than the dtc transfer words, and the transfer is terminated by a transmit error.
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 542 of 982 rej09b0054-0500 14.6.3 rxrdy flag and overrun error 1. the rxrdy flag indicates that ierbr stores data. reading from ierbr by the dtc clears the rxrdy flag. meanwhile, the rxrdy flag must be cleared by software since reading from ierbr by the cpu does not clear the rxrdy flag. 2. if the cpu fails to read from ierbr by the timing of the frame reception or if the number of transfer words is less than the length specified by the message length bits, an overrun error occurs. 3. the ieb receives data while the rxrdy flag is set and sets the ove flag when the parity bit reception starts. if the ove flag is set when the acknowledge bit is transmitted, the ieb assumes that an overrun error has occurred, returns a nak, and discards the data in the receive shift register. 4. on the transmit side, the unit continues retransfer until an ack is received because it receives a nak. 5. if the ove flag is cleared without loading the receive data from ierbr in the rxe interrupt handling routine caused when the ove flag is set to 1, the ieb decides that the overrun error has been cleared and sends an ack to other units. in this case, the transmit unit completes the communications correctly. however, no receive data is loaded from the ierbr and the receive unit continues reception. accordingly, in an interrupt handling routine caused by the ove flag, receive data must be loaded from ierbr, the rxrdy flag must be cleared. the dtc, thus, should be ready to receive the next byte, and then the ove flag must be cleared. 6. item 5 above will not occur when the dtc transfer words is specified as the ierbfl value. 14.6.4 error flag s in the ietef (1) al flag the al flag is set to 1 when arbitration is lost even if retransfer is performed for the number of times specified by iemcr after arbitration has been lost. the al flag is not set when arbitration is won during retransfer. if the al flag is set to 1, the txe flag is set and the wait state is entered. (2) ue flag if the ue flag is set to 1, the txe flag is set and the wait state is entered. for details, see section 14.6.2, txrdy flag and underrun error. (3) ttme flag if a timing error occurs during data transfer, the ttme and txe flags are set, and the wait state is entered.
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 543 of 982 rej09b0054-0500 (4) ro flag when retransfer is performed up to the maximum number of transfer bytes defined by the protocol because of reception of a nak from the receive side during data field transmission, the number of transferred bytes may be less than that of bytes specified by the message length. at this time the ro flag is set. moreover, when the value of the message length bits is greater than the maximum number of transfer bytes, the ro flag is also set. the ro flag is not set if the maximum number of transfer bytes defined by the protocol is specified (for example, 32-byte message length is specified in mode 1) and the transfer is performed correctly. if the ro flag is set to 1, the txe flag is set to 1 and the wait state is entered. (5) ack flag ? if a nak is received in an acknowledge bit before the message length field transmission, the ack flag is set, the txe flag is set, and then the wait state is entered. ? if a nak is received in an acknowledge bit of the data field, data is automatically retransmitted up to the maximum number of transfer bytes defined by the protocol. if an ack is received in an acknowledge bit during retransfer and the following data is transmitted correctly, the ack flag is not set. if a nak is received in the last data transfer during the retransfer for the maximum number of transfer bytes, the ack flag is set to 1 and the wait state is entered. note: even if a nak is received from the receive side during the data field transmission, retransfer is performed up to the maximum number of transfer bytes defined by the protocol, and the number of transferred bytes is less than that of bytes specified by the message length bits, an ack may be received in the acknowledge bit in the last data transfer. in this case, the ack flag is not set although the ro flag is set. 14.6.5 error flags in ieref (1) ove flag when the ove flag is set, the rxe flag is also set. if an overrun error is cleared and the ove flag is also cleared, the iebus receive operation is continued. for details, see section 14.6.3, rxrdy flag and overrun error. (2) rtme flag if a timing error occurs during data reception after reception starts (the rxs flag is set to 1), the rtme flag is set to 1, rxe flag is set to 1, and the wait state is entered. when a timing error occurs before reception starts, this flag is not set and the reception frame is discarded.
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 544 of 982 rej09b0054-0500 (3) dle flag when retransfer is performed up to the maximum number of transfer bytes defined by the protocol because of reception of a nak caused by a parity or an overrun error during data field reception, the number of transferred bytes may be greater than that of bytes specified by the message length. at this time the dle flag is set. moreover, when the value of the message length bits is greater than the maximum number of transfer bytes, the dle flag is also set. the dle flag is not set if the maximum number of transfer bytes defined by the protocol is specified and the transfer is performed correctly. if the dle flag is set to 1, the rxe flag is set to 1 and the wait state is entered. (4) pe flag if a parity error occurs after reception starts (the rxs flag is set to 1), a nak is sent to perform re- reception. if a parity error is not cleared when the maximum number of transfer bytes specified by the protocol is received, the pe flag is set to 1, the rxe flag is set to 1 and the wait state is entered. if a parity error is cleared during the rereception and if the following data is received correctly, the pe flag is not set. notes: 1. if the reception is performed up to the maximum number of transfer bytes defined by the protocol because of a parity or an overrun error during data field reception, the number of receive bytes is less than that of bytes specified by the message length bits, no parity error or overrun error may occur at the last byte reception. in this case, the dle flag is set. however, the ove and pe flags are not set. 2. the flags in ieref are set after reception starts. accordingly, the rxe flag is valid and set after the rxs flag has been set. if an error occurs before reception starts, the frame is discarded and no interrupt occurs. 14.6.6 notes on slave transmission when the slave unit transmits the slave status and upper and lower locked addresses, a parity or an overrun error occurs in the master reception side and the data cannot be received. accordingly, even if a nak is returned, the slave unit is not capable of retransfer. in this case, the master unit must discard the frame in which an error occurred and request the above operation in the master reception to receive the correct frame.
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 545 of 982 rej09b0054-0500 14.6.7 notes on dtc specification when transmit or receive data is transferred by the dtc, bit 5 (for transmission) or bit 6 (for reception) in dtcerg must be set by the bit manipulation instruction (such as bset or bclr). in this case, other bits (bits 7 and 4 to 0) in dtcerg must not be set to 1. 14.6.8 error handling in transmission figure 14.15 shows the operation when a timing error occurs. when a timing error occurs in data transmission (1), there is a possibility that the next data is already transferred to the transmit buffer by the dtc and the txrdy flag that is the dtc initiation source is already cleared to 0 (2). in this case, if retransfer is performed, data remained in the transmit buffer (previous frame data) is transmitted as the first byte data of the data field (3). to avoid this error, in master transmission, the first byte data in the data field should be written to the transmit buffer by software instead of using the dtc. after that, data can be transferred by the dtc. in this case, the sar (transfer source address) and cra (transfer counter) should be specified as follows. ? an address of the on-chip memory that stores the second byte data sar ? the number of bytes specified by message length ?1 cra s ma sa cf lf d1 s ma sa cf lf d2 d1 (1) (2) (3) ietsr transmit error frame timing error legend: s: ma: sa: cf: lf: d1, d2, ...dn-1, dn: data field start bit, broadcast bit master address field slave address field control field message length field 1st byte data transferred by dtc 1st byte data transferred by dtc 2nd byte data transferred by dtc retransfer frame txrdy ietef ttme figure 14.15 error processing in transfer
section 14 iebus? controller (ieb) [h8s/2258 group] rev. 5.00 aug 08, 2006 page 546 of 982 rej09b0054-0500 14.6.9 power-down mode operation the ieb stops operation and is initialized in power-down modes such as module stop, watch, software standby and hardware standby modes. to initialize the ieb, the module stop mode must be specified. to reduce power consumption during ieb operation, the sleep mode must be used. 14.6.10 notes on middle-speed mode in middle-speed mode, the ieb registers must not be read from or written to. 14.6.11 notes on register access the ieb registers can be accessed in bytes. the ieb registers must not be accessed in words or longwords.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 547 of 982 rej09b0054-0500 section 15 serial communication interface (sci) this lsi has independent serial communication interfaces (scis). the sci can handle both asynchronous and clocked synchronous serial communication. serial data communication can be carried out using standard asynchronous communication chips such as a universal asynchronous receiver/transmitter (uart) or an asynchronous communication interface adapter (acia). a function is also provided for serial communication between processors (multiprocessor communication function). the sci also supports an ic card (smart card) interface conforming to iso/iec 7816-3 (identification card) as a serial communication interface extended function. 15.1 features ? the number of on-chip channels h8s/2258 group, h8s/2239 group, h8s/2238 group, and h8s/2237 group: four channels (channels 0, 1, 2, and 3) h8s/2227 group: three channels (channels 0, 1, and 3) ? choice of asynchronous or clocked synchronous serial communication mode ? full-duplex communication capability the transmitter and receiver are mutually independent, enabling transmission and reception to be executed simultaneously. double-buffering is used in both the transmitter and the receiver, enabling continuous transmission and continuous reception of serial data. ? on-chip baud rate generator allows any bit rate to be selected external clock can be selected as a transfer clock source (except for in smart card interface mode). ? choice of lsb-first or msb-first transfer (except in the case of asynchronous mode 7-bit data) ? four interrupt sources transmit-end, transmit-data-empty, receive-data-full, and receive error ? that can issue requests. the transmit-data-empty interrupt and receive data full interrupts can be used to activate the data transfer controller (dtc) or the direct memory access controller (dmac) (h8s/2239 group only). ? module stop mode can be set asynchronous mode ? data length: 7 or 8 bits ? stop bit length: 1 or 2 bits
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 548 of 982 rej09b0054-0500 ? parity: even, odd, or none ? receive error detection: parity, overrun, and framing errors ? break detection: break can be detected by reading the rxd pin level directly in the case of a framing error ? average transfer rate generator (sci_0): 720 kbps, 460.784 kbps, or 115.192 kbps can be selected at 16-mhz operation (h8s/2239 group only). ? transfer rate clock can be input from the tpu (sci_0) (h8s/2239 group only). ? communications between multi-processors are possible. clocked synchronous mode ? data length: 8 bits ? receive error detection: overrun errors detected ? sci selection (sci_0) : when irq7 = 1, fixed input of txd0 = hi-z and sck0 = high can be selected. (h8s/2239 group only) smart card interface ? automatic transmission of error signal (parity error) in receive mode ? error signal detection and automatic data retransmission in transmit mode ? direct convention and inverse convention both supported
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 549 of 982 rej09b0054-0500 figure 15.1 shows a block diagram of the sci (except sci_0 of the h8s/2239 group), and figure 15.2 shows that of the sci_0 of the h8s/2239 group. rxd txd sck clock external clock /4 /16 /64 tei txi rxi eri rsr: rdr: tsr: tdr: smr: scr: ssr: scmr: brr: receive shift register receive data register transmit shift register transmit data register serial mode register serial control register serial status register smart card mode register bit rate register scmr ssr scr smr transmission/ reception control baud rate generator brr module data bus bus interface rdr tsr rsr parity generation parity check legend: tdr internal data bus figure 15.1 block diagram of sci
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 550 of 982 rej09b0054-0500 rxd0 txd0 pg1/ irq7 sck0 tei txi rxi eri scmr ssr scr smr semr brr rdr tsr rsr tdr tioca1 tclka tioca2 tpu external clock transmission/ reception control baud rate generator module data bus bus interface parity generation internal data bus clock /4 /16 /64 rsr: rdr: tsr: tdr: smr: receive shift register receive data register transmit shift register transmit data register serial mode register scr: ssr: scmr: brr: semr: serial control register serial status register smart card mode register bit rate register serial expansion mode register legend: parity check 10.667-mhz operation 115.152 kbps 460.606 kbps 16-mhz operation 115.196 kbps 460.784 kbps 720 kbps average transfer rate generator c/ a cke1 sse figure 15.2 block diagram of sci_0 of h8s/2239 group
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 551 of 982 rej09b0054-0500 15.2 input/output pins table 15.1 shows the pin configuration for each sci channel. table 15.1 pin configuration channel pin name * 1 i/o function sck0 i/o sci0 clock input/output rxd0 input sci0 receive data input 0 txd0 output sci0 transmit data output sck1 i/o sci1 clock input/output rxd1 input sci1 receive data input 1 txd1 output sci1 transmit data output sck2 i/o sci2 clock input/output rxd2 input sci2 receive data input 2 * 2 txd2 output sci2 transmit data output sck3 i/o sci3 clock input/output rxd3 input sci3 receive data input 3 txd3 output sci3 transmit data output notes: 1. pin names sck, rxd, and txd are used in the text for all channels, omitting the channel designation. 2. the channel is not provided for the h8s/2227 group. 15.3 register descriptions the sci has the following registers for each channel. for details on register addresses and register states during each process, refer to appendix a, internal i/o register. the serial mode register (smr), serial status register (ssr), and serial control register (scr) are described separately for normal serial communication interface mode and smart card interface mode because their bit functions differ in part. ? receive shift register (rsr) ? receive data register (rdr) ? transmit data register (tdr) ? transmit shift register (tsr) ? serial mode register (smr) ? serial control register (scr)
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 552 of 982 rej09b0054-0500 ? serial status register (ssr) ? smart card mode register (scmr) ? bit rate register (brr) ? serial expansion mode register (semr0)* note: * this register is in the channel 0 of the h8s/2239 group only. 15.3.1 receive shift register (rsr) rsr is a shift register that is used to receive serial data input to the rxd pin and convert it into parallel data. when one byte of data has been received, it is transferred to rdr automatically. rsr cannot be directly accessed by the cpu. 15.3.2 receive data register (rdr) rdr is an 8-bit register that stores received data. when the sci has received one byte of serial data, it transfers the received serial data from rsr to rdr, where it is stored. after this, rsr is receive-enabled. as rsr and rdr function as a double buffer in this way, continuous receive operations are possible. after confirming that the rdrf bit in ssr is set to 1, read rdr only once. rdr cannot be written to by the cpu. rdr is initialized to h'00 by a reset, in standby mode, watch mode, subactive mode, subsleep mode, or module stop mode. 15.3.3 transmit data register (tdr) tdr is an 8-bit register that stores data for transmission. when the sci detects that tsr is empty, it transfers the transmit data written in tdr to tsr and starts transmission. the double-buffered structure of tdr and tsr enables continuous serial transmission. if the next transmit data has already been written to tdr during serial transmission, the sci transfers the written data to tsr to continue transmission. although tdr can be read or written to by the cpu at all times, to achieve reliable serial transmission, write transmit data to tdr only once after confirming that the tdre bit in ssr is set to 1. tdr is initialized to h'ff by a reset, in standby mode, watch mode, subactive mode, subsleep mode or module stop mode.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 553 of 982 rej09b0054-0500 15.3.4 transmit shift register (tsr) tsr is a shift register that transmits serial data. to perform serial data transmission, the sci first transfers transmit data from tdr to tsr, then sends the data to the txd pin. tsr cannot be directly accessed by the cpu. 15.3.5 serial mode register (smr) smr is used to set the sci?s serial transfer format and select the baud rate generator clock source. some bit functions of smr differ between normal serial communication interface mode and smart card interface mode. ? normal serial communication interface mode (when smif in scmr is 0) bit bit name initial value r/w description 7c/ a 0 r/w communication mode 0: asynchronous mode 1: clocked synchronous mode 6 chr 0 r/w character length (enabled only in asynchronous mode) 0: selects 8 bits as the data length. 1: selects 7 bits as the data length. lsb-first is fixed and the msb (bit 7) of tdr is not transmitted in transmission. in clocked synchronous mode, a fixed data length of 8 bits is used. 5 pe 0 r/w parity enable (enabled only in asynchronous mode) when this bit is set to 1, the parity bit is added to transmit data before transmission, and the parity bit is checked in reception. for a multiprocessor format, parity bit addition and checking are not performed regardless of the pe bit setting.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 554 of 982 rej09b0054-0500 bit bit name initial value r/w description 4o/ e 0 r/w parity mode (enabled only when the pe bit is 1 in asynchronous mode) 0: selects even parity. when even parity is set, parity bit addition is performed in transmission so that the total number of 1 bits in the transmit character plus the parity bit is even. in reception, a check is performed to see if the total number of 1 bits in the receive character plus parity bit is even. 1: selects odd parity. when odd parity is set, parity bit addition is performed in transmission so that the total number of 1 bits in the transmit character plus the parity bit is odd. in reception, a check is performed to see if the total number of 1 bits in the receive character plus the parity bit is odd. 3 stop 0 r/w stop bit length (enabled only in asynchronous mode) selects the stop bit length in transmission. 0: 1 stop bit 1: 2 stop bits in reception, only the first stop bit is checked. if the second stop bit is 0, it is treated as the start bit of the next transmit character. 2 mp 0 r/w multiprocessor mode (enabled only in asynchronous mode) when this bit is set to 1, the multiprocessor communication function is enabled. the pe bit and o/ e bit settings are invalid in multiprocessor mode. for details, see section 15.5, multiprocessor communication function.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 555 of 982 rej09b0054-0500 bit bit name initial value r/w description 1 0 cks1 cks0 0 0 r/w r/w clock select 0 and 1 these bits select the clock source for the baud rate generator. 00: clock (n = 0) 01: /4 clock (n = 1) 10: /16 clock (n = 2) 11: /64 clock (n = 3) for the relationship between the bit rate register setting and the baud rate, see section 15.3.9, bit rate register (brr). n is the decimal representation of the value of n in brr (see section 15.3.9, bit rate register (brr)). ? smart card interface mode (when smif in scmr is 1) bit bit name initial value r/w description 7 gm 0 r/w gsm mode when this bit is set to 1, the sci operates in gsm mode. in gsm mode, the timing of the tend setting is advanced by 11.0 etu (elementary time unit: the time for transfer of 1 bit), and clock output control mode addition is performed. for details, refer to section 15.7.8, clock output control. 0: normal smart card interface mode operation (initial value) ? the tend flag is generated 12.5 etu (11.5 etu in the block transfer mode) after the beginning of the start bit. ? clock output on/off control only 1: gsm mode operation in smart card interface mode ? the tend flag is generated 11.0 etu after the beginning of the start bit. ? in addition to clock output on/off control, high/low fixed control is supported (set using scr).
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 556 of 982 rej09b0054-0500 bit bit name initial value r/w description 6 blk 0 r/w when this bit is set to 1, the sci operates in block transfer mode. for details on block transfer mode, refer to section 15.7.3, block transfer mode. 0: normal smart card interface mode operation (initial value) ? error signal transmission, detection, and automatic data retransmission are performed. ? the txi interrupt is generated by the tend flag. ? the tend flag is set 12.5 etu (11.0 etu in the gsm mode) after transmission starts. 1: operation in block transfer mode ? error signal transmission, detection, and automatic data retransmission are not performed. ? the txi interrupt is generated by the tdre flag. ? the tend flag is set 11.5 etu (11.0 etu in the gsm mode) after transmission starts. 5 pe 0 r/w parity enable (enabled only in asynchronous mode) when this bit is set to 1, the parity bit is added to transmit data in transmission, and the parity bit is checked in reception. in smart card interface mode, this bit must be set to 1. 4o/ e 0 r/w parity mode (enabled only when the pe bit is 1 in asynchronous mode) 0: selects even parity. 1: selects odd parity. for details on setting this bit in smart card interface mode, refer to section 15.7.2, data format (except for block transfer mode).
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 557 of 982 rej09b0054-0500 bit bit name initial value r/w description 3 2 bcp1 bcp0 0 0 r/w r/w base clock pulse 0 and 1 these bits specify the number of base clock periods in a 1-bit transfer interval on the smart card interface. 00: 32 clock (s = 32) 01: 64 clock (s = 64) 10: 372 clock (s = 372) 11: 256 clock (s = 256) for details, refer to section 15.7.4, receive data sampling timing and reception margin. s stands for the value of s in brr (see section 15.3.9, bit rate register (brr)). 1 0 cks1 cks0 0 0 r/w r/w clock select 0 and 1 these bits select the clock source for the baud rate generator. 00: clock (n = 0) 01: /4 clock (n = 1) 10: /16 clock (n = 2) 11: /64 clock (n = 3) for the relationship between the bit rate register setting and the baud rate, see section 15.3.9, bit rate register (brr). n is the decimal representation of the value of n in brr (see section 15.3.9, bit rate register (brr)). note: etu (elementary time unit): time for transfer of 1 bit 15.3.6 serial control register (scr) scr is a register that enables or disables sci transfer operations and interrupt requests, and is also used to selection of the transfer clock source. for details on interrupt requests, refer to section 15.9, interrupt sources. some bit functions of scr differ between normal serial communication interface mode and smart card interface mode.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 558 of 982 rej09b0054-0500 ? normal serial communication interface mode (when smif in scmr is 0) bit bit name initial value r/w description 7 tie 0 r/w transmit interrupt enable when this bit is set to 1, the txi interrupt request is enabled. txi interrupt request cancellation can be performed by reading 1 from the tdre flag in ssr, then clearing it to 0, or clearing the tie bit to 0. 6 rie 0 r/w receive interrupt enable when this bit is set to 1, rxi and eri interrupt requests are enabled. rxi and eri interrupt request cancellation can be performed by reading 1 from the rdrf, fer, per, or orer flag in ssr, then clearing the flag to 0, or clearing the rie bit to 0. 5 te 0 r/w transmit enable when this bit s set to 1, transmission is enabled. in this state, serial transmission is started when transmit data is written to tdr and the tdre flag in ssr is cleared to 0. smr setting must be performed to decide the transfer format before setting the te bit to 1. when this bit is cleared to 0, the transmission operation is disabled, and the tdre flag is fixed at 1. 4 re 0 r/w receive enable when this bit is set to 1, reception is enabled. serial reception is started in this state when a start bit is detected in asynchronous mode or serial clock input is detected in clocked synchronous mode. smr setting must be performed to decide the reception format before setting the re bit to 1. clearing the re bit to 0 does not affect the rdrf, fer, and orer flags, which retain their states.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 559 of 982 rej09b0054-0500 bit bit name initial value r/w description 3 mpie 0 r/w multiprocessor interrupt enable (enabled only when the mp bit in smr is 1 in asynchronous mode) when this bit is set to 1, receive data in which the multiprocessor bit is 0 is skipped, and setting of the rdrf, fer, and orer status flags in ssr is prohibited. on receiving data in which the multiprocessor bit is 1, this bit is automatically cleared and normal reception is resumed. for details, refer to section 15.5, multiprocessor communication function. when receive data including mpb = 0 is received, receive data transfer from rsr to rdr, receive error detection, and setting of the rerf, fer, and orer flags in ssr, are not performed. when receive data including mpb = 1 is received, the mpb bit in ssr is set to 1, the mpie bit is cleared to 0 automatically, and generation of rxi and eri interrupts (when the tie and rie bits in scr are set to 1) and fer and orer flag setting are enabled. 2 teie 0 r/w transmit end interrupt enable this bit is set to 1, tei interrupt request is enabled. tei cancellation can be performed by reading 1 from the dre flag in ssr, then clearing it to 0 and clearing the tend flag to 0, or clearing the teie bit to 0.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 560 of 982 rej09b0054-0500 bit bit name initial value r/w description 1 0 cke1 cke0 0 0 r/w r/w clock enable 0 and 1 selects the clock source and sck pin function. asynchronous mode 00: on-chip baud rate generator sck pin functions as i/o port 01: on-chip baud rate generator outputs a clock of the same frequency as the bit rate from the sck pin. 1 : external clock inputs a clock with a frequency 16 times the bit rate from the sck pin. clocked synchronous mode 0 : internal clock (sck pin functions as clock output) 1 : external clock (sck pin functions as clock input) legend: : don?t care
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 561 of 982 rej09b0054-0500 ? smart card interface mode (when smif in scmr is 1) bit bit name initial value r/w description 7 tie 0 r/w transmit interrupt enable when this bit is set to 1, txi interrupt request is enabled. txi interrupt request cancellation can be performed by reading 1 from the tdre flag in ssr, then clearing it to 0, or clearing the tie bit to 0. 6 rie 0 r/w receive interrupt enable when this bit is set to 1, rxi and eri interrupt requests are enabled. rxi and eri interrupt request cancellation can be performed by reading 1 from the rdrf, fer, per, or orer flag in ssr, then clearing the flag to 0, or clearing the rie bit to 0. 5 te 0 r/w transmit enable when this bit s set to 1, transmission is enabled. in this state, serial transmission is started when transmit data is written to tdr and the tdre flag in ssr is cleared to 0. smr setting must be performed to decide the transfer format before setting the te bit to 1. when this bit is cleared to 0, the transmission operation is disabled, and the tdre flag is fixed at 1. 4 re 0 r/w receive enable when this bit is set to 1, reception is enabled. serial reception is started in this state when a start bit is detected in asynchronous mode or serial clock input is detected in clocked synchronous mode. smr setting must be performed to decide the reception format before setting the re bit to 1. clearing the re bit to 0 does not affect the rdrf, fer, and orer flags, which retain their states.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 562 of 982 rej09b0054-0500 bit bit name initial value r/w description 3mpie 0 r/w multiprocessor interrupt enable (enabled only when the mp bit in smr is 1 in asynchronous mode) write 0 to this bit in smart card interface mode. when receive data including mpb = 0 is received, receive data transfer from rsr to rdr, receive error detection, and setting of the rerf, fer, and orer flags in ssr, are not performed. when receive data including mpb = 1 is received, the mpb bit in ssr is set to 1, the mpie bit is cleared to 0 automatically, and generation of rxi and eri interrupts (when the tie and rie bits in scr are set to 1) and fer and orer flag setting are enabled. 2 teie 0 r/w transmit end interrupt enable write 0 to this bit in smart card interface mode. tei cancellation can be performed by reading 1 from the tdre flag in ssr, then clearing it to 0 and clearing the tend flag to 0, or clearing the teie bit to 0. 1 0 cke1 cke0 0 0 r/w clock enable 0 and 1 enables or disables clock output from the sck pin. the clock output can be dynamically switched in gsm mode. for details, refer to section 15.7.8, clock output control. when the gm bit in smr is 0: 00: output disabled (sck pin can be used as an i/o port pin) 01: clock output 1 : reserved when the gm bit in smr is 1: 00: output fixed low 01: clock output 10: output fixed high 11: clock output legend: : don?t care
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 563 of 982 rej09b0054-0500 15.3.7 serial status register (ssr) ssr is a register containing status flags of the sci and multiprocessor bits for transfer. 1 cannot be written to flags tdre, rdrf, orer, per, and fer; they can only be cleared. some bit functions of ssr differ between normal serial communication interface mode and smart card interface mode. ? normal serial communication interface mode (when smif in scmr is 0) bit bit name initial value r/w description 7 tdre 1 r/(w) * 1 transmit data register empty displays whether tdr contains transmit data. [setting conditions] ? when the te bit in scr is 0 ? when data is transferred from tdr to tsr and data can be written to tdr [clearing conditions] ? when 0 is written to tdre after reading tdre = 1 ? when the dmac * 2 or the dtc * 3 is activated by a txi interrupt request and writes data to tdr 6 rdrf 0 r/(w) * 1 receive data register full indicates that the received data is stored in rdr. [setting condition] when serial reception ends normally and receive data is transferred from rsr to rdr [clearing conditions] ? when 0 is written to rdrf after reading rdrf = 1 ? when the dmac * 2 or the dtc * 3 is activated by an rxi interrupt and transferred data from rdr the rdrf flag is not affected and retains their previous values when the re bit in scr is cleared to 0. if reception of the next data is completed while the rdrf flag is still set to 1, an overrun error will occur and the receive data will be lost.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 564 of 982 rej09b0054-0500 bit bit name initial value r/w description 5 orer 0 r/(w) * 1 overrun error indicates that an overrun error occurred during reception, causing abnormal termination. [setting condition] when the next serial reception is completed while rdrf = 1 the receive data prior to the overrun error is retained in rdr, and the data received subsequently is lost. also, subsequent serial reception cannot be continued while the orer flag is set to 1. in clocked synchronous mode, serial transmission cannot be continued either. [clearing condition] when 0 is written to orer after reading orer = 1 the orer flag is not affected and retains its previous state when the re bit in scr is cleared to 0. 4fer 0 r/(w) * 1 framing error indicates that a framing error occurred during reception in asynchronous mode, causing abnormal termination. [setting condition] when the stop bit is 0 in 2 stop bit mode, only the first stop bit is checked for a value to 1; the second stop bit is not checked. if a framing error occurs, the receive data is transferred to rdr but the rdrf flag is not set. also, subsequent serial reception cannot be continued while the fer flag is set to 1. in clocked synchronous mode, serial transmission cannot be continued, either. [clearing condition] when 0 is written to fer after reading fer = 1 in 2-stop-bit mode, only the first stop bit is checked. the fer flag is not affected and retains its previous state when the re bit in scr is cleared to 0.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 565 of 982 rej09b0054-0500 bit bit name initial value r/w description 3 per 0 r/(w) * 1 parity error indicates that a parity error occurred during reception using parity addition in asynchronous mode, causing abnormal termination. [setting condition] when a parity error is detected during reception if a parity error occurs, the receive data is transferred to rdr but the rdrf flag is not set. also, subsequent serial reception cannot be continued while the per flag is set to 1. in clocked synchronous mode, serial transmission cannot be continued, either. [clearing condition] when 0 is written to per after reading per = 1 the per flag is not affected and retains its previous state when the re bit in scr is cleared to 0. 2 tend 1 r transmit end indicates that transmission has been ended. [setting conditions] ? when the te bit in scr is 0 ? when tdre = 1 at transmission of the last bit of a 1-byte serial transmit character [clearing conditions] ? when 0 is written to tdre after reading tdre = 1 ? when the dmac * 2 or the dtc * 3 is activated by a txi interrupt request and transfer transmission data to tdr 1 mpb 0 r multiprocessor bit mpb stores the multiprocessor bit in the receive data. when the re bit in scr is cleared to 0 its previous state is retained. 0 mpbt 0 r/w multiprocessor bit transfer mpbt stores the multiprocessor bit to be added to the transmit data.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 566 of 982 rej09b0054-0500 notes: 1. only a 0 can be written to this bit, to clear the flag. 2. supported only by the h8s/2239 group. 3. dtc can clear this bit only when disel is 0 with the transfer counter not being 0. ? smart card interface mode (when smif in scmr is 1) bit bit name initial value r/w description 7 tdre 1 r/(w) * 1 transmit data register empty indicates whether tdr contains transmit data. [setting conditions] ? when the te bit in scr is 0 ? when data is transferred from tdr to tsr and data can be written to tdr [clearing conditions] ? when 0 is written to tdre after reading tdre = 1 ? when the dmac * 2 or the dtc * 3 is activated by a txi interrupt request and writes data to tdr 6 rdrf 0 r/(w) * 1 receive data register full indicates that the received data is stored in rdr. [setting condition] when serial reception ends normally and receive data is transferred from rsr to rdr [clearing conditions] ? when 0 is written to rdrf after reading rdrf = 1 ? when the dtc * 3 is activated by an rxi interrupt and transferred data from rdr the rdrf flag is not affected and retains their previous values when the re bit in scr is cleared to 0. if reception of the next data is completed while the rdrf flag is still set to 1, an overrun error will occur and the receive data will be lost.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 567 of 982 rej09b0054-0500 bit bit name initial value r/w description 5 orer 0 r/(w) * 1 overrun error indicates that an overrun error occurred during reception, causing abnormal termination. [setting condition] when the next serial reception is completed while rdrf = 1 the receive data prior to the overrun error is retained in rdr, and the data received subsequently is lost. also, subsequent serial cannot be continued while the orer flag is set to 1. in clocked synchronous mode, serial transmission cannot be continued, either. [clearing condition] when 0 is written to orer after reading orer = 1 the orer flag is not affected and retains its previous state when the re bit in scr is cleared to 0. 4ers 0 r/(w) * 1 error signal status indicates that the status of an error signal returned from the receiving end at reception [setting condition] when the low level of the error signal is sampled [clearing condition] when 0 is written to ers after reading ers = 1 the ers flag is not affected and retains its previous state when the te bit in scr is cleared to 0.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 568 of 982 rej09b0054-0500 bit bit name initial value r/w description 3 per 0 r/(w) * 1 parity error indicates that a parity error occurred during reception using parity addition in asynchronous mode, causing abnormal termination. [setting condition] when a parity error is detected during reception if a parity error occurs, the receive data is transferred to rdr but the rdrf flag is not set. also, subsequent serial reception cannot be continued while the per flag is set to 1. in clocked synchronous mode, serial transmission cannot be continued, either. [clearing condition] when 0 is written to per after reading per = 1 the per flag is not affected and retains its previous state when the re bit in scr is cleared to 0.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 569 of 982 rej09b0054-0500 bit bit name initial value r/w description 2 tend 1 r transmit end this bit is set to 1 when no error signal has been sent back from the receiving end and the next transmit data is ready to be transferred to tdr. [setting conditions] ? when the te bit in scr is 0 and the ers bit is also 0 ? when the ers bit is 0 and the tdre bit is 1 after the specified interval following transmission of 1-byte data. the timing of bit setting differs according to the register setting as follows: when gm = 0 and blk = 0, 12.5 etu after transmission starts when gm = 0 and blk = 1, 11.5 etu after transmission starts when gm = 1 and blk = 0, 11.0 etu after transmission starts when gm = 1 and blk = 1, 11.0 etu after transmission starts [clearing conditions] ? when 0 is written to tdre after reading tdre = 1 ? when the dmac * 2 or the dtc * 3 is activated by a txi interrupt and transfers transmission data to tdr 1 mpb 0 r multiprocessor bit this bit is not used in smart card interface mode. 0 mpbt 0 r/w multiprocessor bit transfer write 0 to this bit in smart card interface mode. notes: 1. only 0 can be written to this bit, to clear the flag. 2. supported only by the h8s/2239 group. 3. dtc can clear this bit only when disel is 0 with the transfer counter not being 0.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 570 of 982 rej09b0054-0500 15.3.8 smart card mode register (scmr) scmr is a register that selects smart card interface mode and its transfer format. bit bit name initial value r/w description 7 to 4 ? all 1 ? reserved these bits are always read as 1, and cannot be modified. 3 sdir 0 r/w smart card data transfer direction selects the serial/parallel conversion format. 0: lsb-first in transfer 1: msb-first in transfer the bit setting is valid only when the transfer data format is 8 bits. for 7-bit data, lsb-first is fixed. 2 sinv 0 r/w smart card data invert specifies inversion of the data logic level. the sinv bit does not affect the logic level of the parity bit. to invert the parity bit, invert the o/ e bit in smr. 0: tdr contents are transmitted as they are. receive data is stored as it is in rdr 1: tdr contents are inverted before being transmitted. receive data is stored in inverted form in rdr 1? 1 ? reserved this bit is always read as 1, and cannot be modified. 0 smif 0 r/w smart card interface mode select this bit is set to 1 to make the sci operate in smart card interface mode. 0: normal asynchronous mode or clocked synchronous mode 1: smart card interface mode
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 571 of 982 rej09b0054-0500 15.3.9 bit rate register (brr) brr is an 8-bit register that adjusts the bit rate. as the sci performs baud rate generator control independently for each channel, different bit rates can be set for each channel. table 15.2 shows the relationships between the n setting in brr and bit rate b for normal asynchronous mode, clocked synchronous mode, and smart card interface mode. the initial value of brr is h'ff, and it can be read or written to by the cpu at all times. table 15.2 the relationships between the n setting in brr and bit rate b communication mode abcs bit * bit rate error 0 b = 64 2 2n ? 1 (n + 1) 10 6 error (%) = { b 64 2 2n ? 1 (n + 1) ? 1 } 100 10 6 asynchronous mode 1 b = 32 2 2n ? 1 (n + 1) 10 6 error (%) = { b 32 2 2n ? 1 (n + 1) ? 1 } 100 10 6 clocked synchronous mode ? b = 8 2 2n ? 1 (n + 1) 10 6 ? smart card interface mode ? b = s 2 2n + 1 (n + 1) 10 6 error (%) = { b s 2 2n + 1 (n + 1) ? 1 } 100 10 6 legend: b: bit rate (bit/s) n: brr setting for baud rate generator (0 n 255) : operating frequency (mhz) n and s: determined by the smr settings shown in the following tables. note: * if the abcs bit is set to 1, sci_0 on the h8s/2239 group only valid bit rate. smr setting smr setting cks1 cks0 clock source n bcp1 bcp0 s 00 00032 01 /4 1 0 1 64 10 /16 2 1 0 372 11 /64 3 1 1 256
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 572 of 982 rej09b0054-0500 table 15.3 shows sample n settings in brr in normal asynchronous mode. table 15.4 shows the maximum bit rate for each frequency in normal asynchronous mode. table 15.6 shows sample n settings in brr in clocked synchronous mode. table 15.8 shows sample n settings in brr in smart card interface mode. in smart card interface mode, s (the number of base clock periods in a 1-bit transfer interval) can be selected. for details, refer to section 15.7.4, receive data sampling timing and reception margin. tables 15.5 and 15.7 show the maximum bit rates with external clock input. when the abcs bit in semr_0 of sci_0 is set to 1 in asynchronous mode, the maximum bit rate is twice the value shown in tables 15.4 and 15.5 (valid for h8s/2239 group only). table 15.3 brr settings for various bit rates (asynchronous mode) operating frequency (mhz) 2 * 3 2.097152 * 3 2.4576 * 3 3 * 3 bit rate (bps) * 1 nn error (%) nn error (%) nn error (%) n n error (%) 110 1 141 0.03 1 148 ?0.04 1 174 ?0.26 1 212 0.03 150 1 103 0.16 1 108 0.21 1 127 0.00 1 155 0.16 300 0 207 0.16 0 217 0.21 0 255 0.00 1 77 0.16 600 0 103 0.16 0 108 0.21 0 127 0.00 0 155 0.16 1200 0 51 0.16 0 54 ?0.70 0 63 0.00 0 77 0.16 2400 0 25 0.16 0 26 1.14 0 31 0.00 0 38 0.16 4800 0 12 0.16 0 13 ?2.48 0 15 0.00 0 19 ?2.34 9600 ? ? ? 0 6 ?2.48 0 7 0.00 0 9 ?2.34 19200 ? ? ? ? ? ? 0 3 0.00 0 4 ?2.34 31250 0 1 0.00 ? ? ? ? ? ? 0 2 0.00 38400 ? ? ? ? ? ? 0 1 0.00 ? ? ?
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 573 of 982 rej09b0054-0500 operating frequency (mhz) 3.6864 * 3 4 * 3 4.9152 * 3 5 * 3 bit rate (bps) * 1 nn error (%) n n error (%) n n error (%) n n error (%) 110 2 64 0.70 2 70 0.03 2 86 0.31 2 88 ?0.25 150 1 191 0.00 1 207 0.16 1 255 0.00 2 64 0.16 300 1 95 0.00 1 103 0.16 1 127 0.00 1 129 0.16 600 0 191 0.00 0 207 0.16 0 255 0.00 1 64 0.16 1200 0 95 0.00 0 103 0.16 0 127 0.00 0 129 0.16 2400 0 47 0.00 0 51 0.16 0 63 0.00 0 64 0.16 4800 0 23 0.00 0 25 0.16 0 31 0.00 0 32 ?1.36 9600 0 11 0.00 0 12 0.16 0 15 0.00 0 15 1.73 19200 0 5 0.00 ? ? ? 0 7 0.00 0 7 1.73 31250 ? ? ? 0 3 0.00 0 4 ?1.70 0 4 0.00 38400 0 2 0.00 ? ? ? 0 3 0.00 0 3 1.73 operating frequency (mhz) 6 * 3 6.144 * 3 7.3728 * 3 8 * 3 bit rate (bps) * 1 nn error (%) nn error (%) nn error (%) nn error (%) 110 2 106 ?0.44 2 108 0.08 2 130 ?0.07 2 141 0.03 150 2 77 0.16 2 79 0.00 2 95 0.00 2 103 0.16 300 1 155 0.16 1 159 0.00 1 191 0.00 1 207 0.16 600 1 77 0.16 1 79 0.00 1 95 0.00 1 103 0.16 1200 0 155 0.16 0 159 0.00 0 191 0.00 0 207 0.16 2400 0 77 0.16 0 79 0.00 0 95 0.00 0 103 0.16 4800 0 38 0.16 0 39 0.00 0 47 0.00 0 51 0.16 9600 0 19 ?2.34 0 19 0.00 0 23 0.00 0 25 0.16 19200 0 9 ?2.34 0 9 0.00 0 11 0.00 0 12 0.16 31250 0 5 0.00 0 5 2.40 ? ? ? 0 7 0.00 38400 0 4 ?2.34 0 4 0.00 0 5 0.00 ? ? ?
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 574 of 982 rej09b0054-0500 operating frequency (mhz) 9.8304 * 3 10 12 12.288 bit rate (bps) * 1 nn error (%) n n error (%) n n error (%) n n error (%) 110 2 174 ?0.26 2 177 ?0.25 2 212 0.03 2 217 0.08 150 2 127 0.00 2 129 0.16 2 155 0.16 2 159 0.00 300 1 255 0.00 2 64 0.16 2 77 0.16 2 79 0.00 600 1 127 0.00 1 129 0.16 1 155 0.16 1 159 0.00 1200 0 255 0.00 1 64 0.16 1 77 0.16 1 79 0.00 2400 0 127 0.00 0 129 0.16 0 155 0.16 0 159 0.00 4800 0 63 0.00 0 64 0.16 0 77 0.16 0 79 0.00 9600 0 31 0.00 0 32 ?1.36 0 38 0.16 0 39 0.00 19200 0 15 0.00 0 15 1.73 0 19 ?2.34 0 19 0.00 31250 0 9 ?1.70 0 9 0.00 0 11 0.00 0 11 2.40 38400 0 7 0.00 0 7 1.73 0 9 ?2.34 0 9 0.00 operating frequency (mhz) 14 * 2 14.7456 * 2 16 * 2 17.2032 * 2 bit rate (bps) * 1 nn error (%) nn error (%) nn error (%) nn error (%) 110 2 248 ?0.17 3 64 0.70 3 70 0.03 3 75 0.48 150 2 181 0.16 2 191 0.00 2 207 0.16 2 223 0.00 300 2 90 0.16 2 95 0.00 2 103 0.16 2 111 0.00 600 1 181 0.16 1 191 0.00 1 207 0.16 1 223 0.00 1200 1 90 0.16 1 95 0.00 1 103 0.16 1 111 0.00 2400 0 181 0.16 0 191 0.00 0 207 0.16 0 223 0.00 4800 0 90 0.16 0 95 0.00 0 103 0.16 0 111 0.00 9600 0 45 ?0.93 0 47 0.00 0 51 0.16 0 55 0.00 19200 0 22 ?0.93 0 23 0.00 0 25 0.16 0 27 0.00 31250 0 13 0.00 0 14 ?1.70 0 15 0.00 0 16 1.20 38400 ? ? ? 0 11 0.00 0 12 0.16 0 13 0.00
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 575 of 982 rej09b0054-0500 operating frequency (mhz) 18 * 2 19.6608 * 2 20 * 2 bit rate (bps) * 1 nn error (%) n n error (%) n n error (%) 110 3 79 ?0.12 3 86 0.31 3 88 ?0.25 150 2 233 0.16 2 255 0.00 3 64 0.16 300 2 116 0.16 2 127 0.00 2 129 0.16 600 1 233 0.16 1 255 0.00 2 64 0.16 1200 1 116 0.16 1 127 0.00 1 129 0.16 2400 0 233 0.16 0 255 0.00 1 64 0.16 4800 0 116 0.16 0 127 0.00 0 129 0.16 9600 0 58 ?0.69 0 63 0.00 0 64 0.16 19200 0 28 1.02 0 31 0.00 0 32 ?1.36 31250 0 17 0.00 0 19 ?1.70 0 19 0.00 38400 0 14 ?2.34 0 15 0.00 0 15 1.73 notes: 1. example when the semr0 register abcs bit is 0. the bit rate is doubled when abcs is set to 1. 2. supported only by the h8s/2239 group. 3. the h8s/2258 group is out of operation.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 576 of 982 rej09b0054-0500 table 15.4 maximum bit rate for each frequency (asynchronous mode) (mhz) maximum bit rate (kbps) nn (mhz) maximum bit rate (kbps) nn 2 * 2 62.5 0 0 9.8304 * 2 307.2 0 0 2.097152 * 2 65.536 0 0 10 312.5 0 0 2.4576 * 2 76.8 0 0 12 375.0 0 0 3 * 2 93.75 0 0 12.288 384.0 0 0 3.6864 * 2 115.2 0 0 14 * 1 437.5 0 0 4 * 2 125.0 0 0 14.7456 * 1 460.8 0 0 4.9152 * 2 153.6 0 0 16 * 1 500.0 0 0 5 * 2 156.25 0 0 17.2032 * 1 537.6 0 0 6 * 2 187.5 0 0 18 * 1 562.5 0 0 6.144 * 2 192.0 0 0 19.6608 * 1 614.4 0 0 7.3728 * 2 230.4 0 0 20 * 1 625.0 0 0 8 * 2 250.0 0 0 notes: 1. supported only by the h8s/2239 group. 2. the h8s/2258 group is out of operation.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 577 of 982 rej09b0054-0500 table 15.5 maximum bit rate with external clock input (asynchronous mode) (mhz) external input clock (mhz) maximum bit rate (kbps) (mhz) external input clock (mhz) maximum bit rate (kbps) 2 * 2 0.5000 31.25 9.8304 * 2 2.4576 153.6 2.097152 * 2 0.5243 32.768 10 2.5000 156.25 2.4576 * 2 0.6144 38.4 12 3.0000 187.5 3 * 2 0.7500 46.875 12.288 3.0720 192.0 3.6864 * 2 0.9216 57.6 14 * 1 3.5000 218.75 4 * 2 1.0000 62.5 14.7456 * 1 3.6864 230.4 4.9152 * 2 1.2288 76.8 16 * 1 4.0000 250.0 5 * 2 1.2500 78.125 17.2032 * 1 4.3008 268.8 6 * 2 1.5000 93.75 18 * 1 4.5000 281.3 6.144 * 2 1.5360 96.0 19.6608 * 1 4.9152 307.2 7.3728 * 2 1.8432 115.2 20 * 1 5.0000 312.5 8 * 2 2.0000 125.0 notes: 1. supported only by the h8s/2239 group. 2. the h8s/2258 group is out of operation.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 578 of 982 rej09b0054-0500 table 15.6 brr settings for various bit rates (clocked synchronous mode) operating frequency (mhz) 2 * 2 4 * 2 6 * 2 8 * 2 bit rate (bps)n nn nn nn n 110 3 70 ? ? 250 2 124 2 249 3 124 500 1 249 2 124 2 249 1 k 1 124 1 249 2 124 2.5 k 0 199 1 99 1 149 1 199 5 k 0 99 0 199 1 74 1 99 10 k 0 49 0 99 0 149 0 199 25 k 0 19 0 39 0 59 0 79 50 k 0 9 0 19 0 29 0 39 100 k 0 4 09014019 250 k 0 1 030507 500 k 0 0 * 010203 1 m 0 0 * 01 2.5 m 5 m
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 579 of 982 rej09b0054-0500 operating frequency (mhz) 10 16 * 1 20 * 1 bit rate (bps) n n n n n n 110 250 ? ? 3 249 500 ? ? 3 124 ? ? 1 k ? ? 2 249 ? ? 2.5 k 1 249 2 99 2 124 5 k 1 124 1 199 1 249 10 k 0 249 1 99 1 124 25 k 0 99 0 159 0 199 50 k 0 49 0 79 0 99 100 k 0 24 0 39 0 49 250 k 0 9 0 15 0 19 500 k 0 4 0709 1 m 0304 2.5 m 0 0 * 01 5 m 0 0 * legend: blank: cannot be set. ?: can be set, but there will be a degree of error. *: continuous transfer is not possible. notes: 1. supported only by the h8s/2239 group. 2. the h8s/2258 group is out of operation. table 15.7 maximum bit rate with external clock input (clocked synchronous mode) (mhz) external input clock (mhz) maximum bit rate (bps) (mhz) external input clock (mhz) maximum bit rate (bps) 2 * 2 0.3333 0.333 12 2.0000 2.000 4 * 2 0.6667 0.667 14 * 1 2.3333 2.333 6 * 2 1.0000 1.000 16 * 1 2.6667 3.667 8 * 2 1.3333 1.333 18 * 1 3.0000 3.000 10 1.6667 1.667 20 * 1 3.3333 3.333 notes 1. supported only by the h8s/2239 group. 2. the h8s/2258 group is out of operation.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 580 of 982 rej09b0054-0500 table 15.8 examples of bit rate for various brr settings (smart card interface mode) (when n = 0 and s = 372) operating frequency (mhz) 5.00 * 2 7.00 * 2 7.1424 * 2 10.00 10.7136 bit rate (bps) n error (%) n error (%) n error (%) n error (%) n error (%) 6720 0 0.01 1 30.00 1 28.57 1 0.01 1 7.14 9600 0 30.00 0 1.99 0 0.00 1 30.00 1 25.00 operating frequency (mhz) 13.00 14.2848 * 1 16.00 * 1 18.00 * 1 20.00 * 1 bit rate (bps) n error (%) n error (%) n error (%) n error (%) n error (%) 6720 2 13.33 2 4.76 2 6.67 3 9.99 3 0.01 9600 1 8.99 1 0.00 1 12.01 2 15.99 2 6.66 notes: 1. supported only by the h8s/2239 group. 2. the h8s/2258 group is out of operation. table 15.9 maximum bit rate at various frequencies (smart card interface mode) (when s = 372) (mhz) maximum bit rate (bps) n n 5.00 * 2 6720 0 0 7.00 * 2 9409 0 0 7.1424 * 2 9600 0 0 10.00 13441 0 0 10.7136 14400 0 0 13.00 17473 0 0 14.2848 * 1 19200 0 0 16.00 * 1 21505 0 0 18.00 * 1 24194 0 0 20.00 * 1 26882 0 0 notes: 1. supported only by the h8s/2239 group. 2. the h8s/2258 group is out of operation.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 581 of 982 rej09b0054-0500 15.3.10 serial expansion mode register (semr_0) semr_0 is an 8-bit register that expands sci_0 functions; such as setting of the base clock, selecting of the clock source, and automatic setting of the transfer rate. note: supported only by the h8s/2239 group only. bit bit name initial value r/w description 7 sse 0 r/w sci_0 select enable this bit enables or disables the sci_0 select function when an external clock is input in clocked synchronous mode. when 1 is set to the pg1/ irq7 pin, while the sci_0 select function is enabled, the txd0 output becomes hi-z and the sck0 input in this lsi is fixed high making the sci_0 data transfer terminated. the sse setting is valid when the external clock input is selected (cke in scr = 0) in clocked synchronous mode (c/ a in smr = 1). 0: sci_0 select is disabled. 1: sci_0 select is enabled. when then pg1/ irq7 pin = 1, the txd0 output becomes hi-z and the sck0 clock input is fixed high. 6 to 4 ? undefined ? reserved these bits are always read as 0, and cannot be modified. 3 abcs 0 r/w asynchronous base clock select selects the 1-bit-interval base clock in asynchronous mode. the abcs setting is valid in asynchronous mode (c/ a in smr = 0). 0: operates on a base clock with a frequency of 16 times the transfer rate. 1: operates on a base clock with a frequency of 8 times the transfer rate.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 582 of 982 rej09b0054-0500 bit bit name initial value r/w description 2 1 0 acs2 acs1 acs0 0 0 0 r/w r/w r/w asynchronous clock source select when an average transfer rate is selected, the base clock is set automatically regardless of the abcs value. note that average transfer rates are not supported for operating frequencies other than 10.667 mhz and 16 mhz. the acs0 to acs0 settings are valid when the external clock input is selected (cke in scr = 0) in asynchronous mode (c/ a in smr = 0). 000: external clock input 001: selects the average transfer rate 115.152 kbps only for = 10.667 mhz (operates on a base clock with a frequency of 16 times the transfer rate). 010: selects the average transfer rate 460.606 kbps only for = 10.667 mhz (operates on a base clock with a frequency of 8 times the transfer rate). 011: reserved 100: tpu clock input (logical and of tioca1 and tioca2) 101: selects the average transfer rate 115.196 kbps only for = 16 mhz (operates on a base clock with a frequency of 16 times the transfer rate). 110: selects the average transfer rate 460.784 kbps only for = 16 mhz (operates on a base clock with a frequency of 16 times the transfer rate). 111: selects the average transfer rate 720 kbps only for = 16 mhz (operates on a base clock with a frequency of 8 times the transfer rate). figures 15.3 and 15.4 show an example of the internal base clock when the average transfer rate is selected.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 583 of 982 rej09b0054-0500 1234567891011 12345678 12 13 14 15 16 17 18 19 20 21 23 22 24 25 26 27 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 1 2 3 4 28 29 5.333 mhz 3.6848 mhz 123 123 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 23 22 4 5 6 7 8 9 10 11 12 13 14 15 16 24 25 26 27 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 1 2 3 4 28 29 2.667 mhz 1.8424 mhz 1 bit = base clock x 16 * base clock 10.667 mhz/4 = 2.667 mhz 2.667 mhz x (38/55) = 1.8424 mhz (average) average transfer rate is 115.152 kbps = 10.667 average transfer rate = 1.8424 mhz/16 = 115.152 kbps average error = ? 0.043% 1 bit = base clock x 8 * base clock 10.667 mhz/2 = 5.333 mhz 5.333 mhz x (38/55) = 3.6848 mhz (average) average transfer rate is 460.606 kbps average transfer rate = 3.6848 mhz/8 = 460.606 kbps average error = ? 0.043% note: * the 1-bit length changes according to the base clock synchronization. figure 15.3 example of the internal base clock when the average transfer rate is selected (1)
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 584 of 982 rej09b0054-0500 12345678910 123 45 678 11 12 13 14 15 16 17 18 19 20 21 23 22 24 25 1 2 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 34 8 mhz 7.3725 mhz 1234567891011121314151617 123456789101112 13141516 18 19 20 21 23 22 24 25 26 27 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 28 29 8 mhz 5.76 mhz 123 2 mhz 1.8431 mhz 4567891011121314151617 123456789101112 13141516 18 19 20 21 23 22 24 25 26 27 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 1 2 3 4 5 6 7 8 28 29 1 bit = base clock x 16 * base clock 16 mhz/8 = 2 mhz 2 mhz x (47/51) = 1.8431 mhz (average) average transfer rate when f = 115.196 kbps average transfer rate = 1.8431 mhz/16 = 115.196 kbps average error with 115.2 kbps = ? 0.004% 1 bit = base clock x 16 * base clock 16 mhz/2 = 8 mhz 8 mhz x (47/51) = 7.3725 mhz (average) average transfer rate when f = 460.784 kbps average transfer rate = 7.3725 mhz/16 = 460.784 kbps average error with 460.8 kbps = ? 0.004% 1 bit = base clock x 16 * base clock 16 mhz/2 = 8 mhz 8 mhz x (18/5) = 5.76 mhz (average) average transfer rate when f = 720 kbps average transfer rate = 5.76 mhz/8 = 720 kbps average error with 720 kbps = ? 0% note: * the 1-bit length changes according to the base clock synchronization. = 16 mhz figure 15.4 example of the internal base clock when the average transfer rate is selected (2)
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 585 of 982 rej09b0054-0500 15.4 operation in asynchronous mode figure 15.5 shows the general format for asynchronous serial communication. one frame consists of a start bit (low level), followed by data, a parity bit, and finally stop bits (high level). in asynchronous serial communication, the transmission line is usually held in the mark state (high level). the sci monitors the transmission line, and when it goes to the space state (low level), recognizes a start bit and starts serial communication. inside the sci, the transmitter and receiver are independent units, enabling full-duplex communication. both the transmitter and the receiver also have a double-buffered structure, so that data can be read or written during transmission or reception, enabling continuous data transfer. in asynchronous mode, the sci performs synchronization at the falling edge of the start bit in reception. the sci samples the data on the 8th pulse of a clock with a frequency of 16 times the length of one bit, so that the transfer data is latched at the center of each bit. the sci_0 samples the data on the 4th pulse of a clock with a frequency of 8 times the length of one bit when the abcs bit in semr_0 is 1 (h8s/2239 group only). lsb start bit msb idle state (mark state) stop bit 0 transmit/receive data d0 d1 d2 d3 d4 d5 d6 d7 0/1 1 1 1 1 serial data parity bit 1 bit 1 or 2 bits 7 or 8 bits 1 bit, or none one unit of transfer data (character or frame) figure 15.5 data format in asynchronous communication (example with 8-bit data, parity, two stop bits) 15.4.1 data transfer format table 15.10 shows the data transfer formats that can be used in asynchronous mode. any of 12 transfer formats can be selected according to the smr setting. for details on the multiprocessor bit, refer to section 15.5, multiprocessor communication function.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 586 of 982 rej09b0054-0500 table 15.10 serial transfer formats (asynchronous mode) pe 0 0 1 1 0 0 1 1 ? ? ? ? s 8-bit data stop s 7-bit data stop s 8-bit data stop stop s 8-bit data p stop s 7-bit data stop p s 8-bit data mpb stop s 8-bit data mpb stop stop s 7-bit data stop mpb s 7-bit data stop mpb stop s 7-bit data stop stop chr 0 0 0 0 1 1 1 1 0 0 1 1 mp 0 0 0 0 0 0 0 0 1 1 1 1 stop 0 1 0 1 0 1 0 1 0 1 0 1 smr settings 123456789101112 serial transfer format and frame length stop s 8-bit data p stop s 7-bit data stop p stop legend: s: start bit stop: stop bit p: parity bit mpb: multiprocessor bit
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 587 of 982 rej09b0054-0500 15.4.2 receive data sampling timing and reception margin in asynchronous mode in asynchronous mode, the sci operates on a base clock with a frequency of 16 times the transfer rate. in reception, the sci samples the falling edge of the start bit using the base clock, and performs internal synchronization. receive data is latched internally at the rising edge of the 8th pulse of the base clock as shown in figure 15.6. thus, the reception margin in asynchronous mode is given by formula (1) below. m = (0.5 ? ? ? ? + % ] 1 2n d ? ... formula (1) where m: reception margin (%) n: bit rate ratio relative to clock (n = 16, but in the h8s/2239 group n = 8 if abcs in semr_0 is set to 1.) d: clock duty (d = 0 to 1.0) l: frame length (l = 9 to 12) f: clock frequency deviation absolute value assuming values of f (absolute value of clock rate deviation) = 0, d (clock duty) = 0.5, and n (ratio of bit rate to clock) = 16 in formula (1), the reception margin can be given by the formula. m = {0.5 ? 1/(2 16)} 100 [%] = 46.875% however, this is only the computed value, and a margin of 20% to 30% should be allowed for in system design. note: example for h8s/2239 group with the abcs bit in semr_0 set to a value other than 1. when abcs is set to 1, the clock frequency is 8 times the bit rate and sampling of received data takes place at the fourth rising edge of the basic clock.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 588 of 982 rej09b0054-0500 internal basic clock 16 clocks 8 clocks receive data (rxd) synchronization sampling timing start bit d0 d1 data sampling timing 15 0 7 15 0 07 note: example for h8s/2239 group with the abcs bit in semr_0 set to a value other than 1. when abcs is set to 1, the clock frequency is 8 times the bit rate and sampling of received data takes place at the fourth rising edge of the basic clock. figure 15.6 receive data sampling timing in asynchronous mode 15.4.3 clock either an internal clock generated by the on-chip baud rate generator or an external clock input at the sck pin can be selected as the sci?s serial clock, according to the setting of the c/ a bit in smr and the cke0 and cke1 bits in scr. when an external clock is input at the sck pin, the clock frequency should be 16 times the bit rate used. when the sci is operated on an internal clock, the clock can be output from the sck pin when setting cke1 = 0 and cke0 = 1. the frequency of the clock output in this case is equal to the bit rate, and the phase is such that the rising edge of the clock is in the middle of the transmit data, as shown in figure 15.7. 0 1 frame d0 d1 d2 d3 d4 d5 d6 d7 0/1 11 sck txd figure 15.7 relationship between output clock and transfer data phase (asynchronous mode)
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 589 of 982 rej09b0054-0500 15.4.4 sci initialization (asynchronous mode) before transmitting and receiving data, you should first clear the te and re bits in scr to 0, then initialize the sci as described in figure 15.8. when the operating mode, or transfer format, is changed for example, the te and re bits must be cleared to 0 before making the change using the following procedure. when the te bit is cleared to 0, the tdre flag is set to 1. note that clearing the re bit to 0 does not initialize the contents of the rdrf, per, fer, and orer flags, or the contents of rdr. when the external clock is used in asynchronous mode, the clock must be supplied even during initialization. wait notes: 1. perform this set operation with the rxd pin in the 1 state. if the re bit is set to 1 with the rxd pin in the 0 state, it may be misinterpreted as a start bit. 2. supported only by the h8s/2239 group. start initialization set data transfer format in smr and scmr [1] set cke1 and cke0 bits in scr (te, re bits 0) no yes set value in brr clear te and re bits in scr to 0 [2] [3] set te and re * 1 bits in scr to 1, and set rie, tie, teie, and mpie bits [4] 1-bit interval elapsed? [1] set the clock selection in scr. be sure to clear bits rie, tie, teie, mpie, te, and re, to 0. when the clock is selected in asynchronous mode, it is output immediately after scr settings are made. [2] set the data transfer format in smr and scmr. [3] write a value corresponding to the bit rate to brr. not necessary if an external clock or an average transfer rate clock by bits acs2 to acs0 in semr_0 * 2 is used. [4] wait at least one bit interval, then set the te bit or re bit in scr to 1. also set the rie, tie, teie, and mpie bits. setting the te and re bits enables the txd and rxd pins to be used. figure 15.8 sample sci initialization flowchart
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 590 of 982 rej09b0054-0500 15.4.5 serial data transmission (asynchronous mode) figure 15.9 shows an example of operation for transmission in asynchronous mode. in transmission, the sci operates as described below. 1. the sci monitors the tdre flag in ssr. if the flag is cleared to 0, the sci recognizes that data has been written to tdr, and transfers the data from tdr to tsr. 2. after transferring data from tdr to tsr, the sci sets the tdre flag to 1 and starts transmission. if the tie bit is set to 1 at this time, a transmit data empty interrupt request (txi) is generated. continuous transmission is possible because the txi interrupt routine writes next transmit data to tdr before transmission of the current transmit data has been completed. 3. data is sent from the txd pin in the following order: start bit, transmit data, parity bit or multiprocessor bit (may be omitted depending on the format), and stop bit. 4. the sci checks the tdre flag at the timing for sending the stop bit. 5. if the tdre flag is 0, the data is transferred from tdr to tsr, the stop bit is sent, and then serial transmission of the next frame is started. 6. if the tdre flag is 1, the tend flag in ssr is set to 1, the stop bit is sent, and then the ?mark state? is entered, in which 1 is output. if the teie bit in scr is set to 1 at this time, a tei interrupt request is generated. tdre tend 0 1 frame d0 d1 d7 0/1 1 0 d0 d1 d7 0/1 1 1 1 data start bit parity bit stop bit start bit data parity bit stop bit txi interrupt request generated data written to tdr and tdre flag cleared to 0 in txi interrupt service routine tei interrupt request generated idle state (mark state) txi interrupt request generated figure 15.9 example of operation in transmission in asynchronous mode (example with 8-bit data, parity, one stop bit)
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 591 of 982 rej09b0054-0500 figure 15.10 shows a sample flowchart for data transmission. no [1] yes initialization start transmission read tdre flag in ssr [2] write transmit data to tdr and clear tdre flag in ssr to 0 no yes no yes read tend flag in ssr [3] no yes [4] clear dr to 0 and set ddr to 1 clear te bit in scr to 0 tdre = 1 all data transmitted? tend = 1 break output? [1] sci initialization: the txd pin is automatically designated as the transmit data output pin. after the te bit is set to 1, a frame of 1s is output, and transmission is enabled. [2] sci status check and transmit data write: read ssr and check that the tdre flag is set to 1, then write transmit data to tdr and clear the tdre flag to 0. [3] serial transmission continuation procedure: to continue serial transmission, read 1 from the tdre flag to confirm that writing is possible, then write data to tdr, and then clear the tdre flag to 0. checking and clearing of the tdre flag is automatic when the dmac * 1 or the dtc * 2 is activated by a transmit-data-empty interrupt (txi) request, and data is written to tdr. [4] break output at the end of serial transmission: to output a break in serial transmission, set dr for the port corresponding to the txd pin to 0, clear ddr to 1, then clear the te bit in scr to 0. notes: 1. supported only by the h8s/2239 group. 2. the case, in which the dtc automatically checks and clears the tdre flag, occurs only when disel in dtc is 0 with the transfer counter not being 0. therefore, the tdre flag should be cleared by cpu when disel is 1, or when disel is 0 with the transfer counter being 0. figure 15.10 sample serial transmission flowchart
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 592 of 982 rej09b0054-0500 15.4.6 serial data reception (asynchronous mode) figure 15.11 shows an example of operation for reception in asynchronous mode. in serial reception, the sci operates as described below. 1. the sci monitors the communication line. if a start bit is detected, the sci performs internal synchronization, receives receive data in rsr, and checks the parity bit and stop bit. 2. if an overrun error occurs (when reception of the next data is completed while the rdrf flag is still set to 1), the orer bit in ssr is set to 1. if the rie bit in scr is set to 1 at this time, an eri interrupt request is generated. receive data is not transferred to rdr. the rdrf flag remains to be set to 1. 3. if a parity error is detected, the per bit in ssr is set to 1 and receive data is transferred to rdr. if the rie bit in scr is set to 1 at this time, an eri interrupt request is generated. 4. if a framing error is detected (when the stop bit is 0), the fer bit in ssr is set to 1 and receive data is transferred to rdr. if the rie bit in scr is set to 1 at this time, an eri interrupt request is generated. 5. if reception is completed successfully, the rdrf bit in ssr is set to 1, and receive data is transferred to rdr. if the rie bit in scr is set to 1 at this time, an rxi interrupt request is generated. continuous reception is possible because the rxi interrupt routine reads the receive data transferred to rdr before reception of the next receive data has been completed. rdrf fer 0 1 frame d0 d1 d7 0/1 1 0 d0 d1 d7 0/1 0 1 1 data start bit parity bit stop bit start bit data parity bit stop bit eri interrupt request generated by framing error idle state (mark state) rdr data read and rdrf flag cleared to 0 in rxi interrupt service routine rxi interrupt request generated figure 15.11 example of sci operation in reception (example with 8-bit data, parity, one stop bit)
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 593 of 982 rej09b0054-0500 table 15.11 shows the states of the ssr status flags and receive data handling when a receive error is detected. if a receive error is detected, the rdrf flag retains its state before receiving data. reception cannot be resumed while a receive error flag is set to 1. accordingly, clear the orer, fer, per, and rdrf bits to 0 before resuming reception. figure 15.12 shows a sample flow chart for serial data reception. table 15.11 ssr status flags and receive data handling ssr status flag rdrf * orer fer per receive data receive error type 1100lost overrun error 0010transferred to rdrframing error 0001transferred to rdrparity error 1110lost overrun error + framing error 1101lost overrun error + parity error 0011transferred to rdrframing error + parity error 1111lost overrun error + framing error + parity error note: * the rdrf flag retains the state it had before data reception.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 594 of 982 rej09b0054-0500 yes [1] no initialization start reception [2] no yes read rdrf flag in ssr [4] [5] clear re bit in scr to 0 read orer, per, and fer flags in ssr error processing (continued on next page) [3] read receive data in rdr, and clear rdrf flag in ssr to 0 no yes per figure 15.12 sample serial reception data flowchart (1)
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 595 of 982 rej09b0054-0500 [3] error processing parity error processing yes no clear orer, per, and fer flags in ssr to 0 no yes no yes framing error processing no yes overrun error processing orer = 1 fer = 1 break? per = 1 clear re bit in scr to 0 figure 15.12 sample serial reception data flowchart (2)
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 596 of 982 rej09b0054-0500 15.5 multiprocessor communication function use of the multiprocessor communication function enables data transfer between a number of processors sharing communication lines by asynchronous serial communication using the multiprocessor format, in which a multiprocessor bit is added to the transfer data. when multiprocessor communication is performed, each receiving station is addressed by a unique id code. the serial communication cycle consists of two component cycles; an id transmission cycle that specifies the receiving station, and a data transmission cycle. the multiprocessor bit is used to differentiate between the id transmission cycle and the data transmission cycle. if the multiprocessor bit is 1, the cycle is an id transmission cycle; if the multiprocessor bit is 0, the cycle is a data transmission cycle. figure 15.13 shows an example of inter-processor communication using the multiprocessor format. the transmitting station first sends the id code of the receiving station with which it wants to perform serial communication as data with a 1 multiprocessor bit added. it then sends transmit data as data with a 0 multiprocessor bit added. when data with a 1 multiprocessor bit is received, the receiving station compares that data with its own id. the station whose id matches then receives the data sent next. stations whose ids do not match continue to skip data until data with a 1 multiprocessor bit is again received. the sci uses the mpie bit in scr to implement this function. when the mpie bit is set to 1, transfer of receive data from rsr to rdr, error flag detection, and setting the ssr status flags, rdrf, fer, and orer to 1, are inhibited until data with a 1 multiprocessor bit is received. on reception of a receive character with a 1 multiprocessor bit, the mpb bit in ssr is set to 1 and the mpie bit is automatically cleared, thus normal reception is resumed. if the rie bit in scr is set to 1 at this time, an rxi interrupt is generated. when the multiprocessor format is selected, the parity bit setting is rendered invalid. all other bit settings are the same as those in normal asynchronous mode. the clock used for multiprocessor communication is the same as that in normal asynchronous mode.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 597 of 982 rej09b0054-0500 transmitting station receiving station a receiving station b receiving station c receiving station d (id = 01) (id = 02) (id = 03) (id = 04) serial transmission line serial data id transmission cycle = receiving station specification data transmission cycle = data transmission to receiving station specified by id (mpb = 1) (mpb = 0) h'01 h'aa legend: mpb: multiprocessor bit figure 15.13 example of communication using multiprocessor format (transmission of data h'aa to receiving station a) 15.5.1 multiprocessor serial data transmission figure 15.14 shows a sample flowchart for multiprocessor serial data transmission. for an id transmission cycle, set the mpbt bit in ssr to 1 before transmission. for a data transmission cycle, clear the mpbt bit in ssr to 0 before transmission. all other sci operations are the same as those in asynchronous mode.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 598 of 982 rej09b0054-0500 no [1] yes initialization start transmission read tdre flag in ssr [2] write transmit data to tdr and set mpbt bit in ssr no yes no yes read tend flag in ssr [3] no yes [4] clear dr to 0 and set ddr to 1 clear te bit in scr to 0 tdre = 1 all data transmitted? tend = 1 break output? clear tdre flag to 0 [1] sci initialization: the txd pin is automatically designated as the transmit data output pin. after the te bit is set to 1, a frame of 1s is output, and transmission is enabled. [2] sci status check and transmit data write: read ssr and check that the tdre flag is set to 1, then write transmit data to tdr. set the mpbt bit in ssr to 0 or 1. finally, clear the tdre flag to 0. [3] serial transmission continuation procedure: to continue serial transmission, be sure to read 1 from the tdre flag to confirm that writing is possible, then write data to tdr, and then clear the tdre flag to 0. checking and clearing of the tdre flag is automatic when the dmac * 1 or the dtc * 2 is activated by a transmit-data- empty interrupt (txi) request, and data is written to tdr. [4] break output at the end of serial transmission: to output a break in serial transmission, set the port dr to 0, clear ddr to 1, then clear the te bit in scr to 0. notes: 1. supported only by the h8s/2239 group. 2. the case, in which the dtc automatically clears the tdre flag, occurs only when disel in dtc is 0 with the transfer counter not being 0. therefore, the tdre flag should be cleared by cpu when disel is 1, or when disel is 0 with the transfer counter being 0. figure 15.14 sample multiprocessor serial transmission flowchart
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 599 of 982 rej09b0054-0500 15.5.2 multiprocessor serial data reception figure 15.16 shows a sample flowchart for multiprocessor serial data reception. if the mpie bit in scr is set to 1, data is skipped until data with a 1 multiprocessor bit is sent. on receiving data with a 1 multiprocessor bit, the receive data is transferred to rdr. an rxi interrupt request is generated at this time. all other sci operations are the same as in asynchronous mode. figure 15.15 shows an example of sci operation for multiprocessor format reception. mpie rdr value 0 d0 d1 d7 1 1 0 d0 d1 d7 0 1 1 1 data (id1) start bit multi- processor bit multi- processor bit multi- processor bit multi- processor bit stop bit start bit data (data1) stop bit data (id2) start bit stop bit start bit data (data2) stop bit rxi interrupt request (multiprocessor interrupt) generated mark state (idle state) rdrf rdr data read and rdrf flag cleared to 0 in rxi interrupt service routine if not this station ? s id, mpie bit is set to 1 again rxi interrupt request is not generated, and rdr retains its state id1 (a) data does not match station's id mpie rdr value 0 d0 d1 d7 1 1 0 d0 d1 d7 0 1 1 1 rxi interrupt request (multiprocessor interrupt) generated mark state (idle state) rdrf rdr data read and rdrf flag cleared to 0 in rxi interrupt service routine matches this station ? s id, so reception continues, and data is received in rxi interrupt service routine mpie bit set to 1 again id2 (b) data matches station's id data2 id1 mpie = 0 mpie = 0 figure 15.15 example of sci operation in reception (example with 8-bit data, multiprocessor bit, one stop bit)
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 600 of 982 rej09b0054-0500 yes [1] no initialization start reception no yes [4] clear re bit in scr to 0 error processing (continued on next page) [5] no yes fer ? s id. if the data is not this station's id, set the mpie bit to 1 again, and clear the rdrf flag to 0. if the data is this station's id, clear the rdrf flag to 0. [4] sci status check and data reception: read ssr and check that the rdrf flag is set to 1, then read the data in rdr. [5] receive error processing and break detection: if a receive error occurs, read the orer and fer flags in ssr to identify the error. after performing the appropriate error processing, ensure that the orer and fer flags are all cleared to 0. reception cannot be resumed if either of these flags is set to 1. in the case of a framing error, a break can be detected by reading the rxd pin value. figure 15.16 sample multiprocessor serial reception flowchart (1)
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 601 of 982 rej09b0054-0500 error processing yes no clear orer, per, and fer flags in ssr to 0 no yes no yes framing error processing overrun error processing orer = 1 fer = 1 break? clear re bit in scr to 0 [5] figure 15.16 sample multiprocessor serial reception flowchart (2)
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 602 of 982 rej09b0054-0500 15.6 operation in clocked synchronous mode figure 15.17 shows the general format for clocked synchronous communication. in clocked synchronous mode, data is transmitted or received synchronous with clock pulses. in clocked synchronous serial communication, data on the transmission line is output from one falling edge of the serial clock to the next. in clocked synchronous mode, the sci receives data in synchronous with the rising edge of the serial clock. after 8-bit data is output, the transmission line holds the msb state. in clocked synchronous mode, no parity or multiprocessor bit is added. inside the sci, the transmitter and receiver are independent units, enabling full-duplex communication through the use of a common clock. both the transmitter and the receiver also have a double-buffered structure, so data can be read or written during transmission or reception, enabling continuous data transfer. don't care don't care one unit of transfer data (character or frame) bit 0 serial data synchronization clock bit 1 bit 3 bit 4 bit 5 lsb msb bit 2 bit 6 bit 7 * * note: * high except in continuous transfer figure 15.17 data format in synchronous communication (for lsb-first) 15.6.1 clock either an internal clock generated by the on-chip baud rate generator or an external synchronization clock input at the sck pin can be selected, according to the setting of cke0 and cke1 bits in scr. when the sci is operated on an internal clock, the serial clock is output from the sck pin. eight serial clock pulses are output in the transfer of one character, and when no transfer is performed the clock is fixed high. 15.6.2 sci initialization (clocked synchronous mode) before transmitting and receiving data, the te and re bits in scr should be cleared to 0, then the sci should be initialized as described in a sample flowchart in figure 15.18. when the operating mode, or transfer format, is changed for example, the te and re bits must be cleared to 0 before making the change using the following procedure. when the te bit is cleared to 0, the tdre flag is set to 1. note that clearing the re bit to 0 does not change the contents of the rdrf, per, fer, and orer flags, or the contents of rdr.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 603 of 982 rej09b0054-0500 wait start initialization set data transfer format in smr and scmr no yes set value in brr clear te and re bits in scr to 0 [2] [3] set te and re bits in scr to 1, and set rie, tie, teie, and mpie bits [4] 1-bit interval elapsed? set cke1 and cke0 bits in scr (te, re bits 0) [1] [1] set the clock selection in scr. be sure to clear bits rie, tie, teie, and mpie, te and re, to 0. [2] set the data transfer format in smr and scmr. [3] write a value corresponding to the bit rate to brr. not necessary if an external clock is used. [4] wait at least one bit interval, then set the te bit or re bit in scr to 1. also set the rie, tie teie, and mpie bits. setting the te and re bits enables the txd and rxd pins to be used. note: in simultaneous transmit and receive operations, the te and re bits should both be cleared to 0 or set to 1 simultaneously. figure 15.18 sample sci initialization flowchart 15.6.3 serial data transmission (clocked synchronous mode) figure 15.19 shows an example of sci operation for transmission in clocked synchronous mode. in serial transmission, the sci operates as described below. 1. the sci monitors the tdre flag in ssr, and if the flag is 0, the sci recognizes that data has been written to tdr, and transfers the data from tdr to tsr. 2. after transferring data from tdr to tsr, the sci sets the tdre flag to 1 and starts transmission. if the tie bit in scr is set to 1 at this time, a transmit data empty interrupt (txi) is generated. continuous transmission is possible because the txi interrupt routine writes the next transmit data to tdr before transmission of the current transmit data has been completed.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 604 of 982 rej09b0054-0500 3. 8-bit data is sent from the txd pin synchronized with the output clock when output clock mode has been specified, and synchronized with the input clock when use of an external clock has been specified. 4. the sci checks the tdre flag at the timing for sending the msb (bit 7). 5. if the tdre flag is cleared to 0, data is transferred from tdr to tsr, and serial transmission of the next frame is started. 6. if the tdre flag is set to 1, the tend flag in ssr is set to 1, and the tdre flag maintains the output state of the last bit. if the teie bit in scr is set to 1 at this time, a tei interrupt request is generated. the sck pin is fixed high. figure 15.20 shows a sample flow chart for serial data transmission. even if the tdre flag is cleared to 0, transmission will not start while a receive error flag (orer, fer, or per) is set to 1. make sure that the receive error flags are cleared to 0 before starting transmission. note that clearing the re bit to 0 does not clear the receive error flags. transfer direction bit 0 serial data synchronization clock 1 frame tdre tend data written to tdr and tdre flag cleared to 0 in txi interrupt service routine txi interrupt request generated bit 1 bit 7 bit 0 bit 1 bit 6 bit 7 txi interrupt request generated tei interrupt request generated figure 15.19 sample sci transmission operation in clocked synchronous mode
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 605 of 982 rej09b0054-0500 no [1] yes initialization start transmission read tdre flag in ssr [2] write transmit data to tdr and clear tdre flag in ssr to 0 no yes no yes read tend flag in ssr [3] clear te bit in scr to 0 tdre = 1 all data transmitted? tend = 1 [1] sci initialization: the txd pin is automatically designated as the transmit data output pin. [2] sci status check and transmit data write: read ssr and check that the tdre flag is set to 1, then write transmit data to tdr and clear the tdre flag to 0. [3] serial transmission continuation procedure: to continue serial transmission, be sure to read 1 from the tdre flag to confirm that writing is possible, then write data to tdr, and then clear the tdre flag to 0. checking and clearing of the tdre flag is automatic when the dmac * 1 or the dtc * 2 is activated by a transmit data empty interrupt (txi) request and data is written to tdr. notes: 1. supported only by the h8s/2239 group. 2. the case, in which the dtc automatically clears the tdre flag, occurs only when disel in dtc is 0 with the transfer counter not being 0. therefore, the tdre flag should be cleared by cpu when disel is 1, or when disel is 0 with the transfer counter being 0. figure 15.20 sample serial transmission flowchart
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 606 of 982 rej09b0054-0500 15.6.4 serial data reception (clocked synchronous mode) figure 15.21 shows an example of sci operation for reception in clocked synchronous mode. in serial reception, the sci operates as described below. 1. the sci performs internal initialization synchronous with a synchronous clock input or output, starts receiving data, and stores the received data in rsr. 2. if an overrun error occurs (when reception of the next data is completed while the rdrf flag in ssr is still set to 1), the orer bit in ssr is set to 1. if the rie bit in scr is set to 1 at this time, an eri interrupt request is generated, receive data is not transferred to rdr, and the rdrf flag remains to be set to 1. 3. if reception is completed successfully, the rdrf bit in ssr is set to 1, and receive data is transferred to rdr. if the rie bit in scr is set to 1 at this time, an rxi interrupt request is generated. continuous reception is possible because the rxi interrupt routine reads the receive data transferred to rdr before reception of the next receive data has finished. bit 7 serial data synchronization clock 1 frame rdrf orer eri interrupt request generated by overrun error rxi interrupt request generated rdr data read and rdrf flag cleared to 0 in rxi interrupt rxi interrupt request generated bit 0 bit 7 bit 0 bit 1 bit 6 bit 7 figure 15.21 example of sci operation in reception reception cannot be resumed while a receive error flag is set to 1. accordingly, clear the orer, fer, per, and rdrf bits to 0 before resuming reception. figure 15.22 shows a sample flow chart for serial data reception. an overrun error occurs or synchronous clocks are output until the re bit is cleared to 0 when an internal clock is selected and only receive operation is possible. when a transmission and reception will be carried out in a unit of one frame, be sure to carry out a dummy transmission with only one frame by the simultaneous transmit and receive operations at the same time.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 607 of 982 rej09b0054-0500 yes [1] no initialization start reception [2] no yes read rdrf flag in ssr [4] [5] clear re bit in scr to 0 error processing (continued below) [3] read receive data in rdr, and clear rdrf flag in ssr to 0 no yes orer = 1 rdrf = 1 all data received? read orer flag in ssr error processing overrun error processing clear orer flag in ssr to 0 [3] [1] sci initialization: the rxd pin is automatically designated as the receive data input pin. [2] [3] receive error processing: if a receive error occurs, read the orer flag in ssr, and after performing the appropriate error processing, clear the orer flag to 0. transfer cannot be resumed if the orer flag is set to 1. [4] sci status check and receive data read: read ssr and check that the rdrf flag is set to 1, then read the receive data in rdr and clear the rdrf flag to 0. transition of the rdrf flag from 0 to 1 can also be identified by an rxi interrupt. [5] serial reception continuation procedure: to continue serial reception, before the final bit of the current frame is received, reading the rdrf flag, reading rdr, and clearing the rdrf flag to 0 should be finished. the rdrf flag is cleared automatically when the dmac * 1 or the dtc * 2 is activated by a receive data full interrupt (rxi) request and the rdr value is read. notes: 1. supported only by the h8s/2239 group. 2. the case, in which the dtc automatically clears the rdrf flag, occurs only when disel in dtc is 0 with the transfer counter not being 0. therefore, the rdrf flag should be cleared by cpu when disel is 1, or when disel is 0 with the transfer counter being 0. figure 15.22 sample serial reception flowchart
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 608 of 982 rej09b0054-0500 15.6.5 simultaneous serial data transmission and reception (clocked synchronous mode) figure 15.23 shows a sample flowchart for simultaneous serial transmit and receive operations. the following procedure should be used for simultaneous serial data transmit and receive operations. to switch from transmit mode to simultaneous transmit and receive mode, after checking that the sci has finished transmission and the tdre and tend flags are set to 1, clear te to 0. then simultaneously set te and re to 1 with a single instruction. to switch from receive mode to simultaneous transmit and receive mode, after checking that the sci has finished reception, clear re to 0. then after checking that the rdrf and receive error flags (orer, fer, and per) are cleared to 0, simultaneously set te and re to 1 with a single instruction.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 609 of 982 rej09b0054-0500 yes [1] no initialization start transmission/reception [5] error processing [3] read receive data in rdr, and clear rdrf flag in ssr to 0 no yes orer = 1 all data received? [2] read tdre flag in ssr no yes tdre = 1 write transmit data to tdr and clear tdre flag in ssr to 0 no yes rdrf = 1 read orer flag in ssr [4] read rdrf flag in ssr clear te and re bits in scr to 0 [1] sci initialization: the txd pin is designated as the transmit data output pin, and the rxd pin is designated as the receive data input pin, enabling simultaneous transmit and receive operations. [2] sci status check and transmit data write: read ssr and check that the tdre flag is set to 1, then write transmit data to tdr and clear the tdre flag to 0. transition of the tdre flag from 0 to 1 can also be identified by a txi interrupt. [3] receive error processing: if a receive error occurs, read the orer flag in ssr, and after performing the appropriate error processing, clear the orer flag to 0. transmission/reception cannot be resumed if the orer flag is set to 1. [4] sci status check and receive data read: read ssr and check that the rdrf flag is set to 1, then read the receive data in rdr and clear the rdrf flag to 0. transition of the rdrf flag from 0 to 1 can also be identified by an rxi interrupt. [5] serial transmission/reception continuation procedure: to continue serial transmission/ reception, before the final bitof the current frame is received, finish reading the rdrf flag, reading rdr, and clearing the rdrf flag to 0. also, before the final bit of the current frame is transmitted, read 1 from the tdre flag to confirm that writing is possible. then write data to tdr and clear the tdre flag to 0. checking and clearing of the tdre flag is automatic when the dtc * 2 is activated by a transmit data empty interrupt (txi) request and data is written to tdr. also, the rdrf flag is cleared automatically when the dmac * 1 or the dtc * 2 is activated by a receive data full interrupt (rxi) request and the rdr value is read. notes: when switching from transmit or receive operation to simultaneous transmit and receive operations, first clear the te bit and re bit to 0, then set both these bits to 1 by one instruction simultaneously. 1. supprted only by the h8s/2239 group. 2. the case, in which the dtc automatically clears the tdre flag or rdrf flag, occurs only when disel in the corresponding dtc transfer is 0 with the transfer counter not being 0. therefore, the corresponding flag should be cleared by cpu when disel in the corresponding dtc transfer is 1, or when disel is 0 with the transfer counter being 0. figure 15.23 sample flowchart of simultaneous serial transmit and receive operations
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 610 of 982 rej09b0054-0500 15.7 operation in smart card interface the sci supports an ic card (smart card) interface that conforms to iso/iec 7816-3 (identification card) as a serial communication interface extension function. switching between the normal serial communication interface and the smart card interface mode is carried out by means of a register setting. 15.7.1 pin connection example figure 15.24 shows an example of connection with the smart card. in communication with an ic card, as both transmission and reception are carried out on a single data transmission line, the txd pin and rxd pin should be connected to the lsi pin. the data transmission line should be pulled up to the v cc power supply with a resistor. if an ic card is not connected, and the te and re bits are both set to 1, closed transmission/reception is possible, enabling self-diagnosis to be carried out. when the clock generated on the smart card interface is used by an ic card, the sck pin output is input to the clk pin of the ic card. this lsi port output is used as the reset signal. txd rxd this lsi v cc i/o connected equipment ic card data line clock line reset line clk rst sck px (port) figure 15.24 schematic diagram of smart card interface pin connections 15.7.2 data format (except for block transfer mode) figure 15.25 shows the transfer data format in smart card interface mode. ? one frame consists of 8-bit data plus a parity bit in asynchronous mode. ? in transmission, a guard time of at least 2 etu (elementary time unit: the time for transfer of 1 bit) is left between the end of the parity bit and the start of the next frame. ? if a parity error is detected during reception, a low error signal level is output for one etu period, 10.5 etu after the start bit. ? if an error signal is sampled during transmission, the same data is retransmitted automatically after a delay of 2 etu or longer.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 611 of 982 rej09b0054-0500 ds d0 d1 d2 d3 d4 d5 d6 d7 dp when there is no parity error transmitting station output ds d0 d1 d2 d3 d4 d5 d6 d7 dp when a parity error occurs transmitting station output de receiving station output start bit data bits parity bit error signal legend: ds: d7 to d0: dp: de: figure 15.25 normal smart card interface data format data transfer with other types of ic cards (direct convention and inverse convention) are performed as described in the following. ds azzazz z za a (z) (z) state d0 d1 d2 d3 d4 d5 d6 d7 dp figure 15.26 direct convention (sdir = sinv = o/ e e e e = 0) with the direction convention type ic and the above sample start character, the logic 1 level corresponds to state z and the logic 0 level to state a, and transfer is performed in lsb-first order. the start character data above is h'3b. for the direct convention type, clear the sdir and sinv bits in scmr to 0. according to smart card regulations, clear the o/ e bit in smr to 0 to select even parity mode. ds azzaaa z aa a (z) (z) state d7 d6 d5 d4 d3 d2 d1 d0 dp figure 15.27 inverse convention (sdir = sinv = o/ e e e e = 1) with the inverse convention type, the logic 1 level corresponds to state a and the logic 0 level to state z, and transfer is performed in msb-first order. the start character data for the above is h'3f. for the inverse convention type, set the sdir and sinv bits in scmr to 1. according to smart card regulations, even parity mode is the logic 0 level of the parity bit, and corresponds to
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 612 of 982 rej09b0054-0500 state z. in this lsi, the sinv bit inverts only data bits d0 to d7. therefore, set the o/ e bit in smr to 1 to invert the parity bit for both transmission and reception. 15.7.3 block transfer mode operation in block transfer mode is the same as that in the normal smart card interface mode, except for the following points. ? in reception, though the parity check is performed, no error signal is output even if an error is detected. however, the per bit in ssr is set to 1 and must be cleared before receiving the parity bit of the next frame. ? in transmission, a guard time of at least 1 etu is left between the end of the parity bit and the start of the next frame. ? in transmission, because retransmission is not performed, the tend flag is set to 1, 11.5 etu after transmission start. ? as with the normal smart card interface, the ers flag indicates the error signal status, but since error signal transfer is not performed, this flag is always cleared to 0. 15.7.4 receive data sampling timing and reception margin in smart card interface mode an internal clock generated by the on-chip baud rate generator can only be used as a transmission/reception clock. in this mode, the sci operates on a base clock with a frequency of 32, 64, 372, or 256 times the transfer rate (fixed to 16 times in normal asynchronous mode) as determined by bits bcp1 and bcp0. in reception, the sci samples the falling edge of the start bit using the base clock, and performs internal synchronization. as shown in figure 15.28, by sampling receive data at the rising-edge of the 16th, 32nd, 186th, or 128th pulse of the base clock, data can be latched at the middle of the bit. the reception margin is given by the following formula. m = | (0.5 ? ? ? ? + % 1 2n | d ? where m: reception margin (%) n: ratio of bit rate to clock (n = 32, 64, 372, and 256) d: clock duty (d = 0 to 1.0) l: frame length (l = 10) f: absolute value of clock frequency deviation assuming values of f = 0, d = 0.5 and n = 372 in the above formula, the reception margin formula is as follows.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 613 of 982 rej09b0054-0500 m = (0.5 ? 1/2 372) 100% = 49.866% internal basic clock 372 clocks 186 clocks receive data (rxd) synchronization sampling timing d0 d1 data sampling timing 185 371 0 371 185 0 0 start bit figure 15.28 receive data sampling timing in smart card mode (using clock of 372 times the transfer rate) 15.7.5 initialization before transmitting and receiving data, initialize the sci as described below. initialization is also necessary when switching from transmit mode to receive mode, or vice versa. 1. clear the te and re bits in scr to 0. 2. clear the error flags ers, per, and orer in ssr to 0. 3. set the gm, blk, o/ e , bcp0, bcp1, cks0, cks1 bits in smr. set the pe bit to 1. 4. set the smif, sdir, and sinv bits in scmr. when the smif bit is set to 1, the txd and rxd pins are both switched from ports to sci pins, and are placed in the high-impedance state. 5. set the value corresponding to the bit rate in brr. 6. set the cke0 and cke1 bits in scr. clear the tie, rie, te, re, mpie, and teie bits to 0. if the cke0 bit is set to 1, the clock is output from the sck pin. 7. wait at least one bit interval, then set the tie, rie, te, and re bits in scr. do not set the te bit and re bit at the same time, except for self-diagnosis. to switch from receive mode to transmit mode, after checking that the sci has finished reception, initialize the sci, and set re to 0 and te to 1. whether sci has finished reception or not can be checked with the rdrf, per, or orer flags. to switch from transmit mode to receive mode,
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 614 of 982 rej09b0054-0500 after checking that the sci has finished transmission, initialize the sci, and set te to 0 and re to 1. whether sci has finished transmission or not can be checked with the tend flag. 15.7.6 serial data transmission (except for block transfer mode) as data transmission in smart card interface mode involves error signal sampling and retransmission processing, the operations are different from those in normal serial communication interface mode (except for block transfer mode). figure 15.29 illustrates the retransfer operation when the sci is in transmit mode. 1. if an error signal is sent back from the receiving end after transmission of one frame is complete, the ers bit in ssr is set to 1. if the rie bit in scr is enabled at this time, an eri interrupt request is generated. the ers bit in ssr should be cleared to 0 by the time the next parity bit is sampled. 2. the tend bit in ssr is not set for a frame in which an error signal indicating an abnormality is received. data is retransferred from tdr to tsr, and retransmitted automatically. 3. if an error signal is not sent back from the receiving end, the ers bit in ssr is not set. transmission of one frame, including a retransfer, is judged to have been completed, and the tend bit in ssr is set to 1. if the tie bit in scr is enabled at this time, a txi interrupt request is generated. writing transmit data to tdr transfers the next transmit data. figure 15.31 shows a flowchart for transmission. a sequence of transmit operations can be performed automatically by specifying the dtc to be activated with a txi interrupt source. in a transmit operation, the tdre flag is set to 1 at the same time as the tend flag in ssr is set, and a txi interrupt will be generated if the tie bit in scr has been set to 1. if the txi request is designated beforehand as a dtc activation source, the dtc will be activated by the txi request, and transfer of the transmit data will be carried out. at this moment, if disel in dtc is 0 with the transfer counter not being 0, the tdre and tend flags are automatically cleared to 0 when data is transferred by the dtc. when disel is 1, or disel is 0 with the transfer counter being 0, the dtc writes the transfer data to the tdr but does not clear the flag. therefore, the flag should be cleared by cpu. in addition, in the event of the error, the sci retransmits the same data automatically. during this period, the tend flag remains cleared to 0 and the dtc is not activated. therefore, the sci and dtc will automatically transmit the specified number of bytes in the event of an error, including retransmission. however, the ers flag is not cleared automatically when an error occurs, and so the rie bit should be set to 1 beforehand so that an eri request will be generated in the event of an error, and the ers flag will be cleared. when performing transfer using the dtc, it is essential to set and enable the dtc before carrying out sci setting. for details of the dtc setting procedures, refer to section 9, data transfer controller (dtc).
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 615 of 982 rej09b0054-0500 d0 d1 d2 d3 d4 d5 d6 d7 dp de ds d0 d1 d2 d3 d4 d5 d6 d7 dp (de) ds d0 d1 d2 d3 d4 ds transfer frame n + 1st retransferred frame nth transfer frame tdre tend fer/ers transfer to tsr from tdr transfer to tsr from tdr transfer to tsr from tdr figure 15.29 retransfer operation in sci transmit mode the timing for setting the tend flag depends on the value of the gm bit in smr. the tend flag set timing is shown in figure 15.30. ds d0 d1 d2 d3 d4 d5 d6 d7 dp i/o data 12.5 etu txi (tend interrupt) 11.0 etu de guard time when gm = 0 when gm = 1 start bit data bits parity bit error signal legend: ds: d7 to d0: dp: de: figure 15.30 tend flag generation timing in transmission operation
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 616 of 982 rej09b0054-0500 initialization no yes clear te bit to 0 start transmission start no no no yes yes yes yes no end write data to tdr, and clear tdre flag in ssr to 0 error processing error processing tend = 1? all data transmitted ? tend = 1? ers = 0? ers = 0? figure 15.31 example of transmission processing flow
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 617 of 982 rej09b0054-0500 15.7.7 serial data reception (except for block transfer mode) data reception in smart card interface mode uses the same operation procedure as for normal serial communication interface mode. figure 15.32 illustrates the retransfer operation when the sci is in receive mode. 1. if an error is found when the received parity bit is checked, the per bit in ssr is automatically set to 1. if the rie bit in scr is set at this time, an eri interrupt request is generated. the per bit in ssr should be kept cleared to 0 until the next parity bit is sampled. 2. the rdrf bit in ssr is not set for a frame in which an error has occurred. 3. if no error is found when the received parity bit is checked, the per bit in ssr is not set to 1, the receive operation is judged to have been completed normally, and the rdrf flag in ssr is automatically set to 1. if the rie bit in scr is enabled at this time, an rxi interrupt request is generated. figure 15.33 shows a flowchart for reception. a sequence of receive operations can be performed automatically by specifying the dtc to be activated using an rxi interrupt source. in a receive operation, an rxi interrupt request is generated when the rdrf flag in ssr is set to 1. if the rxi request is designated beforehand as a dtc activation source, the dtc will be activated by the rxi request, and the receive data will be transferred. at this moment, if disel in dtc is 0 with the transfer counter not being 0, the rdrf flag is automatically cleared. when disel is 1, or disel is 0 with the transfer counter being 0, the dtc transfers receive data but does not clear the flag. therefore, the flag should be cleared by cpu. if an error occurs in receive mode and the orer or per flag is set to 1, a transfer error interrupt (eri) request will be generated. hence, so the error flag must be cleared to 0. in the event of an error, the dtc is not activated and receive data is skipped. therefore, receive data is transferred for only the specified number of bytes in the event of an error. even when a parity error occurs in receive mode and the per flag is set to 1, the data that has been received is transferred to rdr and can be read from there. note: for details on receive operations in block transfer mode, refer to section 15.4, operation in asynchronous mode. d0 d1 d2 d3 d4 d5 d6 d7 dp de ds d0 d1 d2 d3 d4 d5 d6 d7 dp (de) ds d0 d1 d2 d3 d4 ds transfer frame n+1st retransferred frame nth transfer frame rdrf per figure 15.32 retransfer operation in sci receive mode
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 618 of 982 rej09b0054-0500 initialization read rdr and clear rdrf flag in ssr to 0 clear re bit to 0 start reception start error processing no no no yes yes orer = 0 and per = 0 rdrf = 1? all data received? yes figure 15.33 example of reception processing flow 15.7.8 clock output control when the gm bit in smr is set to 1, the clock output level can be fixed with bits cke0 and cke1 in scr. at this time, the minimum clock pulse width can be made the specified width. figure 15.34 shows the timing for fixing the clock output level. in this example, gm is set to 1, cke1 is cleared to 0, and the cke0 bit is controlled. specified pulse width sck cke0 specified pulse width figure 15.34 timing for fixing clock output level
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 619 of 982 rej09b0054-0500 when turning on the power or switching between smart card interface mode and software standby mode, the following procedures should be followed in order to maintain the clock duty. powering on: to secure clock duty from power-on, the following switching procedure should be followed. 1. the initial state is port input and high impedance. use a pull-up resistor or pull-down resistor to fix the potential. 2. fix the sck pin to the specified output level with the cke1 bit in scr. 3. set smr and scmr, and switch to smart card mode operation. 4. set the cke0 bit in scr to 1 to start clock output. when changing from smart card interface mode to software standby mode: 1. set the data register (dr) and data direction register (ddr) corresponding to the sck pin to the value for the fixed output state in software standby mode. 2. write 0 to the te bit and re bit in the serial control register (scr) to halt transmit/receive operation. at the same time, set the cke1 bit to the value for the fixed output state in software standby mode. 3. write 0 to the cke0 bit in scr to halt the clock. 4. wait for one serial clock period. during this interval, clock output is fixed at the specified level, with the duty preserved. 5. make the transition to the software standby state. when returning to smart card interface mode from software standby mode: 1. exit the software standby state. 2. write 1 to the cke0 bit in scr and output the clock. signal generation is started with the normal duty. software standby normal operation normal operation figure 15.35 clock halt and restart procedure
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 620 of 982 rej09b0054-0500 15.8 sci select function (h8s/2239 group only) sci_0 provides the sci select function that enables one-to-one clocked synchronous communication between a master lsi and multiple slave lsis (these lsis). figure 15.36 shows an example of communication using the sci select function and figure 15.37 shows the summary of its operation. the master lsi enables to communicate with the slave lsi_a by setting the sel_a signal to low and the sel_b signal to high. in this case, the txd0_b pin of the slave lsi_b becomes hi-z and that fixes the on-chip sck0_b signal high, causing the communication terminated. to communicate with the slave lsi_b, set the sel_a signal to high and the sel_b signal to low.* the slave lsi detects its being selected by the low input interrupt of irq7 and handles data transferring smoothly. note: * change the select signal of the master lsi ( sel_a or sel_b ) while the serial clock (m_sck) is high after the last bit of the transmit data has been output. in addition, set only one select signal to low at a time. interrupt controller tsr0_a rsr0_a transfer control slave lsi_a (this lsi) master lsi sck0_a c/a = cke1 = sse = 1 slave lsi_b (this lsi) sel_a irq7 irq7 sel_b m_txd rxd0 txd0 rxd0 txd0 sck0 sck0 m_rxd m_sck figure 15.36 example of communication using sci select function
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 621 of 982 rej09b0054-0500 m_sck [master lsi] [salve lsi_a] m_txd m_rxd sel_a ( sel_a ) ( sel_b ) sel_b irq7 [salve lsi_b] irq7 d0 d0 d1 d1 d7 d7 d0 d1 d7 d0 d0 d1 d1 d7 d7 d0 d1 d7 sck0_a rsr0_a txd0_a sck0_b rsr0_b txd0_b hi-z hi-z hi-z fixed high fixed high hi-z d0 d6 d7 d0 d6 d7 master lsi salve lsi_a communication master lsi salve lsi_b communication figure 15.37 summary of sci select function operation
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 622 of 982 rej09b0054-0500 15.9 interrupt sources 15.9.1 interrupts in normal serial communication interface mode table 15.12 shows the interrupt sources in normal serial communication interface mode. a different interrupt vector is assigned to each interrupt source, and individual interrupt sources can be enabled or disabled using the enable bits in scr. when the tdre flag in ssr is set to 1, a txi interrupt request is generated. when the tend flag in ssr is set to 1, a tei interrupt request is generated. a txi interrupt can activate the dtc to perform data transfer. the tdre flag is cleared to 0 automatically when data is transferred by the dmac * 1 or the dtc * 2 . when the rdrf flag in ssr is set to 1, an rxi interrupt request is generated. when the orer, per, or fer flag in ssr is set to 1, an eri interrupt request is generated. an rxi interrupt request can activate the dmac * 1 or the dtc * 2 to transfer data. the rdrf flag is cleared to 0 automatically when data is transferred by the dmac * 1 or the dtc * 2 . a tei interrupt is requested when the tend flag is set to 1 and the teie bit is set to 1. if a tei interrupt and a txi interrupt are requested simultaneously, the txi interrupt has priority for acceptance. however, if the tdre and tend flags are cleared simultaneously by the txi interrupt routine, the sci cannot branch to the tei interrupt routine later. notes: 1. supported only by the h8s/2239 group. 2. the flag is cleared only when disel in dtc is 0 with the transfer counter not being 0.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 623 of 982 rej09b0054-0500 table 15.12 interrupt sources of serial communication interface mode channel name interrupt source interrupt flag dtc activation dmac activation * 2 priority * 1 eri0 receive error orer, fer, per not possible not possible high rxi0 receive data full rdrf possible possible txi0 transmit data empty tdre possible possible 0 tei0 transmission end tend not possible not possible eri1 receive error orer, fer, per not possible not possible rxi1 receive data full rdrf possible possible txi1 transmit data empty tdre possible possible 1 tei1 transmission end tend not possible not possible eri2 receive error orer, fer, per not possible not possible rxi2 receive data full rdrf possible not possible txi2 transmit data empty tdre possible not possible 2 * 3 tei2 transmission end tend not possible not possible eri3 receive error orer, fer, per not possible not possible rxi3 receive data full rdrf possible not possible txi3 transmit data empty tdre possible not possible 3 tei3 transmission end tend not possible not possible low notes: 1. indicates the initial state immediately after a reset. priorities in channels can be changed by the interrupt controller. 2. supported only by the h8s/2239 group. 3. not available in the h8s/2227 group.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 624 of 982 rej09b0054-0500 15.9.2 interrupts in smart card interface mode table 15.13 shows the interrupt sources in smart card interface mode. the transmit end interrupt (tei) request cannot be used in this mode. note: in case of block transfer mode, see section 15.9.1, interrupts in normal serial communication interface mode. table 15.13 interrupt sources in smart card interface mode channel name interrupt source interrupt flag dtc activation dmac activation * 2 priority * 1 eri0 receive error, detection orer, per, ers not possible not possible high rxi0 receive data full rdrf possible possible 0 txi0 transmit data empty tend possible possible eri1 receive error, detection orer, per, ers not possible not possible rxi1 receive data full rdrf possible possible 1 txi1 transmit data empty tend possible possible eri2 receive error, detection orer, per, ers not possible not possible rxi2 receive data full rdrf possible not possible 2 * 3 txi2 transmit data empty tend possible not possible eri3 receive error, detection orer, per, ers not possible not possible rxi3 receive data full rdrf possible not possible 3 txi3 transmit data empty tend possible not possible low notes: 1. indicates the initial state immediately after a reset. priorities in channels can be changed by the interrupt controller. 2. supported only by the h8s/2239 group. 3. not available in the h8s/2227 group.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 625 of 982 rej09b0054-0500 15.10 usage notes 15.10.1 module stop mode setting sci operation can be disabled or enabled using the module stop control register. the initial setting is for sci operation to be halted. register access is enabled by clearing module stop mode. for details, refer to section 24, power-down modes. 15.10.2 break detection and processing (asynchronous mode only) when framing error (fer) detection is performed, a break can be detected by reading the rxd pin value directly. in a break, the input from the rxd pin becomes all 0s, setting the fer flag, and possibly the per flag. note that as the sci continues the receive operation after receiving a break, even if the fer flag is cleared to 0, it will be set to 1 again. 15.10.3 mark state and break detection (asynchronous mode only) when te is 0, the txd pin is used as an i/o port whose direction (input or output) and level are determined by ddr. this can be used to set the txd pin to mark state (high level) or send a break during serial data transmission. to maintain the communication line at mark state until te is set to 1, set both ddr and dr to 1. as te is cleared to 0 at this point, the txd pin becomes an i/o port, and 1 is output from the txd pin. to send a break during serial transmission, first set pdr to 1 and dr to 0, and then clear te to 0. when te is cleared to 0, the transmitter is initialized regardless of the current transmission state, the txd pin becomes an i/o port, and 0 is output from the txd pin. 15.10.4 receive error flags and transmit operations (clocked synchronous mode only) transmission cannot be started when a receive error flag (orer, per, or fer) is set to 1, even if the tdre flag is cleared to 0. be sure to clear the receive error flags to 0 before starting transmission. note also that receive error flags cannot be cleared to 0 even if the re bit is cleared to 0.
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 626 of 982 rej09b0054-0500 15.10.5 restrictions on use of dmac * or dtc ? when an external clock source is used as the serial clock, the transmit clock should not be input until at least 5 clock cycles after the tdr is updated by the dmac* or the dtc. misoperation may occur if the transmit clock is input within 4 clocks after tdr is updated (figure 15.38). ? when rdr is read by the dmac* or the dtc, be sure to set the activation source to the relevant sci reception data full interrupt (rxi). ? the flag is cleared only when disel in dtc is 0 with the transfer counter not being 0. when disel is 1, or disel is 0 with the transfer counter being 0, the flag should be cleared by cpu. note that transmitting, in particular, may not successfully be executed unless the tdre flag is cleared by cpu. note: * supported only by the h8s/2239 group. t d0 lsb serial data sck d1 d3 d4 d5 d2 d6 d7 note: when operating on an external clock, set t > 4 clocks. tdre figure 15.38 example of clocked synchronous transmission by dmac * or dtc note: * supported only by the h8s/2239 group. 15.10.6 operation in case of mode transition ? transmission operation should be stopped (by clearing te, tie, and teie to 0) before making a module stop mode, software standby mode, watch mode, subactive mode, or subsleep mode transition. tsr, tdr, and ssr are reset. the output pin states in module stop mode, software standby mode, watch mode, subactive mode, or subsleep mode depend on the port settings, and becomes high-level output after the relevant mode is cleared. if a transition is made during transmission, the data being transmitted will be undefined. when transmitting without changing the transmit mode after the relevant mode is cleared, transmission can be started by setting te to 1 again, and performing the following sequence: ssr read tdr write
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 627 of 982 rej09b0054-0500 tdre clearance. to transmit with a different transmit mode after clearing the relevant mode, the procedure must be started again from initialization. figure 15.39 shows a sample flowchart for mode transition during transmission. port pin states are shown in figures 15.40 and 15.41. operation should also be stopped (by clearing te, tie, and teie to 0) before making a transition from transmission by dtc transfer to module stop mode, software standby mode, watch mode, subactive mode, or subsleep mode transition. to perform transmission with the dtc after the relevant mode is cleared, setting te and tie to 1 will set the txi flag and start dtc transmission. read tend flag in ssr te = 0 transition to software standby mode, etc. exit from software standby mode, etc. change operating mode? no all data transmitted? tend = 1 yes yes yes no no [1] [3] [2] te = 1 initialization [1] data being transmitted is interrupted. after exiting software standby mode, etc., normal cpu transmission is possible by setting te to 1, reading ssr, writing tdr, and clearing tdre to 0, but note that if the dtc has been activated, the remaining data in dtcram will be transmitted when te and tie are set to 1. [2] if tie and teie are set to 1, clear them to 0 in the same way. [3] includes module stop mode, watch mode, subactive mode, and subsleep mode. figure 15.39 sample flowchart for mode transition during transmission
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 628 of 982 rej09b0054-0500 sck output pin te bit txd output pin port input/output high output port input/output high output start stop start of transmission end of transmission port input/output sci txd output port sci txd output port transition to software standby exit from software standby figure 15.40 asynchronous transmission using internal clock port input/output last txd bit held high outpu t* port input/output marking output port input/output sci txd output port port note: * initialized by software standby. sck output pin te bit txd output pin sci txd output start of transmission end of transmission transition to software standby exit from software standby figure 15.41 synchronous transmission using internal clock
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 629 of 982 rej09b0054-0500 ? reception receive operation should be stopped (by clearing re to 0) before making a module stop mode, software standby mode, watch mode, subactive mode, or subsleep mode transition. rsr, rdr, and ssr are reset. if a transition is made without stopping operation, the data being received will be invalid. to continue receiving without changing the reception mode after the relevant mode is cleared, set re to 1 before starting reception. to receive with a different receive mode, the procedure must be started again from initialization. figure 15.42 shows a sample flowchart for mode transition during reception. re = 0 transition to software standby mode, etc. read receive data in rdr read rdrf flag in ssr exit from software standby mode, etc. change operating mode? no rdrf = 1 yes yes no [1] [2] re = 1 initialization [1] receive data being received becomes invalid. [2] includes module stop mode, watch mode, subactive mode, and subsleep mode. figure 15.42 sample flowchart for mode transition during reception
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 630 of 982 rej09b0054-0500 15.10.7 switching from sck pin function to port pin function ? problem in operation when switching the sck pin function to the output port function (high-level output) by making the following settings while ddr = 1, dr = 1, c/ a = 1, cke1 = 0, cke0 = 0, and te = 1 (synchronous mode), low-level output occurs for one half-cycle. 1. end of serial data transmission 2. te bit = 0 3. c/ a bit = 0 switchover to port output 4. occurrence of low-level output sck/port data te c/ a cke1 cke0 bit 7 bit 6 1. end of transmission 4. low-level output 3. c/ a = 0 2. te = 0 half-cycle low-level output figure 15.43 operation when switching from sck pin function to port pin function ? sample procedure for avoiding low-level output as this sample procedure temporarily places the sck pin in the input state, the sck/port pin should be pulled up beforehand with an external circuit. with ddr = 1, dr = 1, c/ a = 1, cke1 = 0, cke0 = 0, and te = 1, make the following settings in the order shown. 1. end of serial data transmission 2. te bit = 0 3. cke1 bit = 1 4. c/ a bit = 0 switchover to port output 5. cke1 bit = 0
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 631 of 982 rej09b0054-0500 sck/port data te c/ a cke1 cke0 bit 7 bit 6 1. end of transmission 3. cke1 = 1 5. cke1 = 0 4. c/ a = 0 2. te = 0 high-level output figure 15.44 operation when switching from sck pin function to port pin function (example of preventing low-level output) 15.10.8 assignment and selection of registers some serial communication interface registers are assigned to the same address as other registers. register selection is performed by means of the iice bit in the serial control register (scrx). for details on register addresses, see section 26.1, register addresses (in address order).
section 15 serial communication interface (sci) rev. 5.00 aug 08, 2006 page 632 of 982 rej09b0054-0500
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 633 of 982 rej09b0054-0500 section 16 i 2 c bus interface (iic) (option) an i 2 c bus interface is available as an option. observe the following notes when using this option. 1. for masked rom versions, a w is added to the part number in products in which this optional function is used. examples: hd6432239wte the h8s/2258 group, h8s/2239 group, and h8s/2238 group have an internal i 2 c bus interface of two channels. the i 2 c bus interface conforms to and provides a subset of the philips i 2 c bus (inter-ic bus) interface functions. the register configuration that controls the i 2 c bus differs partly from the philips configuration, however. the i 2 c bus interface data transfer is performed using a data line (sda) and a clock line (scl) for each channel, which allows efficient use of connectors and the area of the pcb. notes: 1. an i 2 c bus interface is not available in the h8s/2237 group and h8s/2227 group. 2. when the power supply voltage ranges from 2.2 v to 2.7 v, the i 2 c bus interface is not available. 16.1 features ? selection of i 2 c bus format or clocked synchronous serial format ? i 2 c bus format: addressing format with acknowledge bit, for master/slave operation ? clocked synchronous serial format: non-addressing format without acknowledge bit, for master operation only i 2 c bus format ? two ways of setting slave address ? start and stop conditions generated automatically in master mode ? selection of acknowledge output levels when receiving ? automatic loading of acknowledge bit when transmitting ? wait function in master mode a wait can be inserted by driving the scl pin low after data transfer, excluding acknowledgement. the wait can be cleared by clearing the interrupt flag. ifiic05c_000020020700
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 634 of 982 rej09b0054-0500 ? wait function in slave mode a wait request can be generated by driving the scl pin low after data transfer, excluding acknowledgement. the wait request is cleared when the next transfer becomes possible. ? interrupt sources ? data transfer end (including transmission mode transition with i 2 c bus format and address reception after loss of master arbitration) ? address match: when any slave address matches or the general call address is received in slave receive mode ? start condition detection (in master mode) ? stop condition detection (in slave mode) ? selection of 16 internal clocks (in master mode) ? direct bus drive ? two pins, p35/scl0 and p34/sda0, function as nmos open-drain outputs when the bus drive function is selected. ? two pins, p33/scl1 and p32/sda1, function as nmos-only outputs when the bus drive function is selected. figure 16.1 shows a block diagram of the i 2 c bus interface. figure 16.2 shows an example of i/o pin connections to external circuits. channel i/o pins are nmos open drains, and it is possible to apply voltages in excess of the power supply (vcc) voltage for this lsi. set the upper limit of voltage applied to the power supply (vcc) power supply range +0.3 v. channel 1 i/o pins are driven solely by nmos, so in terms of appearance they carry out the same operations as an nmos open drain. however, the voltage which can be applied to the i/o pins depends on the voltage of the power supply (vcc) of this lsi.
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 635 of 982 rej09b0054-0500 ps noise canceler noise canceler clock control bus state decision circuit arbitration decision circuit output data control circuit address comparator sar, sarx interrupt generator icdrs icdrr icdrt icsr icmr iccr internal data bus interrupt request scl sda legend: iccr: icmr: icsr: icdr: sar: sarx: ps: i 2 c bus control register i 2 c bus mode register i 2 c bus status register i 2 c bus data register slave address register second slave address register prescaler figure 16.1 block diagram of i 2 c bus interface
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 636 of 982 rej09b0054-0500 scl in scl out sda in sda out (slave 1) scl sda scl in scl out sda in sda out (slave 2) scl sda scl in scl out sda in sda out (master) this lsi scl sda v dd v cc scl sda figure 16.2 i 2 c bus interface connections (example: this lsi as master) 16.2 input/output pins table 16.1 shows the pin configuration for the i 2 c bus interface. table 16.1 pin configuration name abbreviation * i/o function serial clock scl0 i/o iic_0 serial clock input/output serial data sda0 i/o iic_0 serial data input/output serial clock scl1 i/o iic_1 serial clock input/output serial data sda1 i/o iic_1 serial data input/output note: * pin names scl and sda are used in the text for all channels, omitting the channel designation. 16.3 register descriptions the i 2 c bus interface has the following registers. registers icdr and sarx and registers icmr and sar are allocated to the same addresses. accessible addresses differ depending on the ice bit in iccr. sar and sarx are accessed when ice is 0, and icmr and icdr are accessed when
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 637 of 982 rej09b0054-0500 ice is 1. for details on the module stop control register, refer to section 24.1.2, module stop control registers a to c (mstpcra to mstpcrc). ? i 2 c bus data register_0 (icdr_0)* ? slave address register_0 (sar_0)* ? second slave address register_0 (sarx_0)* ? i 2 c bus mode register_0 (icmr_0)* ? i 2 c bus control register_0 (iccr_0)* ? i 2 c bus status register_0 (icsr_0)* ? i 2 c bus data register_1 (icdr_1)* ? slave address register_1 (sar_1)* ? second slave address register_1 (sarx_1)* ? i 2 c bus mode register_1 (icmr_1)* ? i 2 c bus control register_1 (iccr_1)* ? i 2 c bus status register_1 (icsr_1)* ? ddc switch register (ddcswr) ? serial control register x (scrx) note: * some of the registers in the i 2 c bus interface are allocated to the same addresses of other registers. the iice bit in serial control register x (scrx) selects each register. 16.3.1 i 2 c bus data register (icdr) icdr is an 8-bit readable/writable register that is used as a transmit data register when transmitting and a receive data register when receiving. icdr is divided internally into a shift register (icdrs), receive buffer (icdrr), and transmit buffer (icdrt). data transfers among the three registers are performed automatically in coordination with changes in the bus state, and affect the status of internal flags such as tdre and rdrf. when tdre is 1 and the transmit buffer is empty, tdre shows that the next transmit data can be written from the cpu. when rdrf is 1, it shows that the valid receive data is stored in the receive buffer. if i 2 c is in transmit mode and the next data is in icdrt (the tdre flag is 0) following transmission/reception of one frame of data using icdrs, data is transferred automatically from icdrt to icdrs. if i 2 c is in receive mode and no previous data remains in icdrr (the rdrf flag is 0) following transmission/reception of one frame of data using icdrs, data is transferred automatically from icdrs to icdrr. if the number of bits in a frame, excluding the acknowledge bit, is less than 8, transmit data and receive data are stored differently. transmit data should be written justified toward the msb side
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 638 of 982 rej09b0054-0500 when mls = 0, and toward the lsb side when mls = 1. receive data bits read from the lsb side should be treated as valid when mls = 0, and bits read from the msb side when mls = 1. icdr can be written and read only when the ice bit is set to 1 in iccr. the value of icdr is undefined after a reset. the tdre and rdrf flags are set and cleared under the conditions shown below. setting the tdre and rdrf flags affects the status of the interrupt flags. bit bit name initial value r/w description ? tdre ?? transmit data register empty [setting conditions] ? in transmit mode, when a start condition is detected in the bus line state after a start condition is issued in master mode with the i 2 c bus format or serial format selected ? when data is transferred from icdrt to icdrs ? when a switch is made from receive mode to transmit mode after detection of a start condition [clearing conditions] ? when transmit data is written in icdr in transmit mode ? when a stop condition is detected in the bus line state after a stop condition is issued with the i 2 c bus format or serial format selected ? when a stop condition is detected with the i 2 c bus format selected ? in receive mode ? rdrf ?? receive data register full [setting condition] when data is transferred from icdrs to icdrr [clearing condition] when icdr (icdrr) receive data is read in receive mode
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 639 of 982 rej09b0054-0500 16.3.2 slave address register (sar) sar selects the slave address and selects the transfer format. sar can be written and read only when the ice bit is cleared to 0 in iccr. bit bit name initial value r/w description 7 6 5 4 3 2 1 sva6 sva5 sva4 sva3 sva2 sva1 sva0 0 0 0 0 0 0 0 r/w r/w r/w r/w r/w r/w r/w slave address 6 to 0 sets a slave address. 0 fs 0 r/w selects the transfer format together with the fsx bit in sarx. refer to table 16.2. 16.3.3 second slave address register (sarx) sarx stores the second slave address and selects the transfer format. sarx can be written and read only when the ice bit is cleared to 0 in iccr. bit bit name initial value r/w description 7 6 5 4 3 2 1 svax6 svax5 svax4 svax3 svax2 svax1 svax0 0 0 0 0 0 0 0 r/w r/w r/w r/w r/w r/w r/w second slave address 6 to 0 sets the second slave address. 0 fsx 1 r/w selects the transfer format together with the fs bit in sar. refer to table 16.2.
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 640 of 982 rej09b0054-0500 table 16.2 transfer format sar sarx fs fsx i 2 c transfer format 0 0 sar and sarx are used as the slave addresses with the i 2 c bus format. 0 1 only sar is used as the slave address with the i 2 c bus format. 1 0 only sarx is used as the slave address with the i 2 c bus format. 1 1 clock synchronous serial format (sar and sarx are invalid) 16.3.4 i 2 c bus mode register (icmr) icmr sets the transfer format and transfer rate. it can only be accessed when the ice bit in iccr is 1. bit bit name initial value r/w description 7 mls 0 r/w msb-first/lsb-first select 0: msb-first 1: lsb-first set this bit to 0 when the i 2 c bus format is used. 6 wait 0 r/w wait insertion bit this bit is valid only in master mode with the i 2 c bus format. when wait is set to 1, after the fall of the clock for the final data bit, the iric flag is set to 1 in iccr, and a wait state begins (with scl at the low level). when the iric flag is cleared to 0 in iccr, the wait ends and the acknowledge bit is transferred. if wait is cleared to 0, data and acknowledge bits are transferred consecutively with no wait inserted. the iric flag in iccr is set to 1 on completion of the acknowledge bit transfer, regardless of the wait setting. 5 4 3 cks2 cks1 cks0 0 0 0 r/w r/w r/w serial clock select 2 to 0 this bit is valid only in master mode. these bits select the required transfer rate, together with the iicx 1 and iicx0 bit in scrx. refer to table 16.3.
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 641 of 982 rej09b0054-0500 bit bit name initial value r/w description 2 1 0 bc2 bc1 bc0 0 0 0 r/w r/w r/w bit counter 2 to 0 these bits specify the number of bits to be transferred next. with the i 2 c bus format, the data is transferred with one addition acknowledge bit. bit bc2 to bc0 settings should be made during an interval between transfer frames. if bits bc2 to bc0 are set to a value other than 000, the setting should be made while the scl line is low. the value returns to 000 at the end of a data transfer, including the acknowledge bit. i 2 c bus format clocked synchronous mode 000: 9 bits 000: 8 bits 001: 2 bits 001: 1 bit 010: 3 bits 010: 2 bits 011: 4 bits 011: 3 bits 100: 5 bits 100: 4 bits 101: 6 bits 101: 5 bits 110: 7 bits 110: 6 bits 111: 8 bits 111: 7 bits
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 642 of 982 rej09b0054-0500 table 16.3 i 2 c transfer rate scrx icmr bit 5 and 6 bit 5 bit 4 bit 3 transfer rate iicx cks2 cks1 cks0 clock = = = = 5 mhz * 3 = = = = 8 mhz * 3 = = = = 10 mhz = = = = 16 mhz * 2 = = = = 20 mhz * 2 0000 /28 179 mhz 286 khz 357 khz 571 khz * 1 714 khz * 1 0001 /40 125 khz 200 khz 250 khz 400 khz 500 khz * 1 0010 /48 104 khz 167 khz 208 khz 333 khz 417 khz * 1 0011 /64 78.1 khz 125 khz 156 khz 250 khz 313 khz 0100 /80 62.5 khz 100 khz 125 khz 200 khz 250 khz 0101 /100 50.0 khz 80.0 khz 100 khz 160 khz 200 khz 0110 /112 44.6 khz 71.4 khz 89.3 khz 143 khz 179 khz 0111 /128 39.1 khz 62.5 khz 78.1 khz 125 khz 156 khz 1000 /56 89.3 khz 143 khz 179 khz 286 khz 357 khz 1001 /80 62.5 khz 100 khz 125 khz 200 khz 250 khz 1010 /96 52.1 khz 83.3 khz 104 khz 167 khz 208 khz 1011 /128 39.1 khz 62.5 khz 78.1 khz 125 khz 156 khz 1100 /160 31.3 khz 50.0 khz 62.5 khz 100 khz 125 khz 1101 /200 25.0 khz 40.0 khz 50.0 khz 80.0 khz 100 khz 1110 /224 22.3 khz 35.7 khz 44.6 khz 71.4 khz 89.3 khz 1111 /256 19.5 khz 31.3 khz 39.1 khz 62.5 khz 78.1 khz notes: 1. out of the range of the i 2 c bus interface specification (normal mode: 100 khz in max, and high-speed mode: 400 khz in max). 2. supported only by the h8s/2239 group. 3. the h8s/2258 group is out of operation.
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 643 of 982 rej09b0054-0500 16.3.5 serial control register x (scrx) scrx controls the iic operating modes. bit bit name initial value r/w description 7 ? 0r/wreserved the initial value should not be changed. 6 5 iicx1 iicx0 0 0 r/w r/w i 2 c transfer rate select 1 and 0 selects the transfer rate in master mode, together with bits cks2 to cks0 in icmr. refer to table 16.3. iicx1 controls iic_1 and iicx0 controls iic_0. 4 iice 0 r/w i 2 c master enable controls cpu access to the iic data register and control registers (iccr, icsr, icdr/sarx, and icmr/sar). 0: cpu access to the iic data register and control registers is disabled. 1: cpu access to the iic data register and control registers is enabled. 3 flshe 0 r/w for details on this bit, refer to section 20.5.7, serial control register x (scrx). 2 to 0 ? all 0 r/w reserved the initial value should not be changed.
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 644 of 982 rej09b0054-0500 16.3.6 i 2 c bus control register (iccr) i 2 c bus control register (iccr) consists of the control bits and interrupt request flags of i 2 c bus interface. bit bit name initial value r/w description 7ice 0 r/wi 2 c bus interface enable when this bit is set to 1, the i 2 c bus interface module is enabled to send/receive data and drive the bus since it is connected to the scl and sda pins. icmr and icdr can be accessed. when this bit is cleared, the module is halted and separated from the scl and sda pins. sar and sarx can be accessed. 6ieic 0 r/wi 2 c bus interface interrupt enable when this bit is 1, interrupts are enabled by iric. 5 4 mst trs 0 0 r/w master/slave select transmit/receive select 00: slave receive mode 01: slave transmit mode 10: master receive mode 11: master transmit mode both these bits will be cleared by hardware when they lose in a bus contention in master mode of the i 2 c bus format. in slave receive mode, the r/ w bit in the first frame immediately after the start automatically sets these bits in receive mode or transmit mode by using hardware. the settings can be made again for the bits that were set/cleared by hardware, by reading these bits. when the trs bit is intended to change during a transfer, the bit will not be switched until the frame transfer is completed, including acknowledgement.
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 645 of 982 rej09b0054-0500 bit bit name initial value r/w description 3 acke 0 r/w acknowledge bit judgement selection 0: the value of the acknowledge bit is ignored, and continuous transfer is performed. the value of the received acknowledge bit is not indicated by the ackb bit, which is always 0. 1: if the acknowledge bit is 1, continuous transfer is interrupted. in this lsi, the dtc can be used to perform continuous transfer. the dtc is activated when the irtr interrupt flag is set to 1 (irtr us one of two interrupt flags, the other being iric). when the acke bit is 0, the tdre, iric, and irtr flags are set on completion of data transmission, regardless o f the acknowledge bit. when the acke bit is 1, the tdre, iric, and irtr flags are set on completion of data transmission when the acknowledge bit is 0, and the iric flag alone is set on completion of data transmission when the acknowledge bit is 1. when the dtc is activated, the tdre, iric, and irtr flags are cleared to 0 after the specified number of data transfers have been executed. consequently, interrupts are not generated during continuos data transfer, but if data transmission is completed with a 1 acknowledge bit when the acke bit is set to 1, the dtc is not activated and an interrupt is generated, if enabled. depending on the receiving device, the acknowledge bit may be significant, in indicating completion of processing of the received data, for instance, or may be fixed at 1 and have no significance. 2 bbsy 0 r/w bus busy in slave mode, reading the bbsy flag enables to confirm whether the i 2 c bus is occupied or released. the bbsy flag is set to 0 when the sda level changes from high to low under the condition of scl = high, assuming that the start condition has been issued. the bbsy flag is cleared to 0 when the sda level changes from low to high under the condition of scl = high, assuming that the start condition has been issued. writing to the bbsy flag in slave mode is disabled. in master mode, the bbsy flag is used to issue start and stop conditions. write 1 to bbsy and 0 to scp to issue a start condition. follow this procedure when also re-transmitting a start condition. to issue a start/stop condition, use the mov instruction. the i 2 c bus interface must be set in master transmit mode before the issue of a start condition.
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 646 of 982 rej09b0054-0500 bit bit name initial value r/w description 1 iric 0 r/w i 2 c bus interface interrupt request flag also see table 16.4. [setting conditions] in i 2 c bus format master mode ? when a start condition is detected in the bus line state after a start condition is issued (when the tdre flag is set to 1 because of first frame transmission) ? when a wait is inserted between the data and acknowledge bit when wait = 1 ? at the end of data transfer (when the tdre or rdrf flag is set to 1) ? when a slave address is received after bus arbitration is lost (when the al flag is set to1) ? when 1 is received as the acknowledge bit when the acke bit is 1(when the ackb bit is set to 1) in i 2 c bus format slave mode ? when the slave address (sva, svax) matches (when the aas and aasx flags are set to 1) and at the end of data transfer up to the subsequent retransmission start condition or stop condition detection (when the tdre or rdrf flag is set to 1) ? when the general call address (one frame including a r/ w bit is h'00) is detected (when the adz flag is set to 1) and at the end of data transfer up to the subsequent retransmission start condition or stop condition detection(when the tdre or rdrf flag is set to 1) ? when 1 is received as the acknowledge bit when the acke bit is 1(when the ackb bit is set to 1) ? when a stop condition is detected (when the stop or estp flag is set to 1) with clocked synchronous serial format ? at the end of data transfer (when the tdre or rdrf flag is set to 1) ? when a start condition is detected with serial format selected when a condition occurs in which internal flag of tdre and rdfr is set to 1 except for the above [clearing conditions] ? when 0 is written in iric after reading iric = 1 ? when icdr is read/written by dtc (when tdre or rdrf flag is cleared to 0) (as it might not be a condition to clear, for details, see section 16.4.8, operation using the dtc).
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 647 of 982 rej09b0054-0500 bit bit name initial value r/w description 0 scp 1 w start condition/stop condition prohibit bit the scp bit controls the issue of start/stop conditions in master mode. to issue a start condition, write 1 in bbsy and 0 in scp. a retransmit start condition is issued in the same way. to issue a stop condition, write 0 in bbsy and 0 in scp. this bit is always read as 1. if 1 is written, the data is not stored. when, with the i 2 c bus format selected, iric is set to 1 and an interrupt is generated, other flags must be checked in order to identify the source that set iric to 1. although each source has a corresponding flag, caution is needed at the end of a transfer. when the tdre or rdrf internal flag is set, the readable irtr flag may or may not be set. even when data transfer is complete, the dtc activation request flag, irtr, is not set until a retransmission start condition or stop condition is detected after a slave address (sva) or general call address matched in the i 2 c bus format slave mode. even when the iric flag and irtr flag are set, the tdre or rdrf internal flag may not be set. for a continuous transfer using the dtc, the iric or irtr flag is not cleared at the completion of the specified number of times of transfers. on the other hand, the tdre and rdrf flags are cleared because the specified number of times of read/write operations have been complete. table 16.4 shows the relationship between the flags and the transfer states.
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 648 of 982 rej09b0054-0500 table 16.4 flags and transfer states mst trs bbsy estp stop irtr aasx al aas adz ackb state 1/01/0000000000idle state (flag clearing r equired) 11000000000start c ondition issuance 11100100000start c ondition established 11/0100000000/1master m ode wait 11/0100100000/1master m ode transmit/receive end 0010001/011/01/00arbitration lost 00100000100sar match by first frame in slave mode 00100000110g eneral call address match 00100010000sarx match 01/0100000000/1slave m ode transmit/receive end (except after sarx match) 0 0 1/0 1 1 1 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 1 slave mode transmit/receive end (after sarx match) 0 1/0 0 1/0 1/0 0 0 0 0 0 0/1 stop condition detected
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 649 of 982 rej09b0054-0500 16.3.7 i 2 c bus status register (icsr) icsr consists of status flags. bit bit name initial value r/w description 7 estp 0 r/(w) * error stop condition detection flag this bit is valid in i 2 c bus format slave mode. [setting condition] when a stop condition is detected during frame transfer [clearing conditions] ? when 0 is written in estp after reading the state of 1 ? when the iric flag is cleared to 0 6stop 0 r/(w) * normal stop condition detection flag this bit is valid in i 2 c bus format slave mode. [setting condition] when a stop condition is detected during frame transfer [clearing conditions] ? when 0 is written in stop after reading stop = 1 ? when the iric flag is cleared to 0 5 irtr 0 r/(w) * i 2 c bus interface continuous transmission/reception interrupt request flag [setting conditions] in i 2 c bus interface slave mode ? when the tdre or rdrf flag is set to 1 when aasx = 1 in i 2 c bus interface other modes ? when the tdre or rdrf flag is set to 1 [clearing conditions] ? when 0 is written in irtr after reading irtr = 1 ? when the iric flag is cleared to 0 while ice is 1
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 650 of 982 rej09b0054-0500 bit bit name initial value r/w description 4 aasx 0 r/(w) * second slave address recognition flag [setting condition] when the second slave address is detected in slave receive mode and fsx = 0 [clearing conditions] ? when 0 is written in aasx after reading aasx = 1 ? when a start condition is detected ? in master mode 3al 0 r/(w) * arbitration lost flag indicates that bus arbitration was lost in master mode. [setting conditions] ? when the internal sda and sda pin do not match at the rise of scl ? when the internal scl is high at the fall of scl [clearing conditions] ? when 0 is written in al after reading al = 1 ? when icdr data is written (transmit mode) or read (receive mode) 2 aas 0 r/(w) * slave address recognition flag [setting condition] when the slave address or general call address (one frame including a r/ w bit is h'00) is detected in slave receive mode and fs = 0 [clearing conditions] ? when icdr data is written (transmit mode) or read (receive mode) ? when 0 is written in aas after reading aas = 1 ? in master mode
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 651 of 982 rej09b0054-0500 bit bit name initial value r/w description 1adz 0 r/(w) * general call address recognition flag in i 2 c bus format slave receive mode, this flag is set to 1 if the first frame following a start condition is the general call address (h'00). [setting condition] when the general call address (one frame including a r/ w bit is h'00) is detected in slave receive mode and (fs = 0 or fsx = 0) [clearing conditions] ? when icdr is written to (transmit mode) or read from (receive mode) ? when 0 is written in adz after reading adz = 1 ? in master mode if a general call address is detected while fs = 1 and fsx = 0, the adz flag is set to 1; however, the general call address is not recognized (aas flag is not set to 1).
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 652 of 982 rej09b0054-0500 bit bit name initial value r/w description 0 ackb 0 r/w acknowledge bit stores acknowledge data. transmit mode: [setting condition] when 1 is received as the acknowledge bit when acke = 1 in transmit mode [clearing conditions] ? when 0 is received as the acknowledge bit when acke = 1 in transmit mode ? when 0 is written to the acke bit receive mode: 0: returns 0 as acknowledge data after data reception 1: returns 1 as acknowledge data after data reception when this bit is read, the value loaded from the bus line (returned by the receiving device) is read in transmission (when trs = 1). in reception (when trs = 0), the value set by internal software is read. when this bit is written, acknowledge data that is returned after receiving is rewritten regardless of the trs value. if bit in icsr is written using bit-manipulation instructions, the acknowledge data should be re-set since the acknowledge data setting is rewritten by the ackb bit reading value. write the acke bit to 0 to clear the ackb flag to 0, before transmission is ended and a stop condition is issued in master mode, or before transmission is ended and sda is released to issue a stop condition by a master device. note: * only a 0 can be written to this bit, to clear the flag.
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 653 of 982 rej09b0054-0500 16.3.8 ddc switch register (ddcswr) ddcswr controls the i 2 c bus interface format automatic switching function and internal latch clear. bit bit name initial value r/w description 7 to 4 ? all 0 r/(w) * reserved the write value should always be 0. 3 2 1 0 clr3 clr2 clr1 clr0 1 1 1 1 w w w w i 2 c bus interface clear 3 to 0 when bits clr3 to clr0 are set, a clear signal is generated for the i 2 c bus interface internal latch circuit, and the internal state is initialized. the write data for these bits is not retained. to perform i 2 c clearance, bits clr3 to clr0 must be written to simultaneously using an mov instruction. do not use a bit manipulation instruction such as bclr. 00 : setting prohibited 0100: setting prohibited 0101: iic_0 internal latch cleared 0110: iic_1 internal iatch cleared 0111: iic_0, iic_1 internal iatch cleared 1 : invalid setting legend: : don?t care note: * only 0 can be written to these bits, to clear the flag. 16.4 operation the i 2 c bus interface has serial and i 2 c bus formats. 16.4.1 i 2 c bus data format the i 2 c bus formats are addressing formats and an acknowledge bit is inserted. the first frame following a start condition always consists of 8 bits. the i 2 c bus format is shown in figure 16.3. the clocked synchronous serial format is a non-addressing format with no acknowledge bit. this is shown in figure 16.4. figure 16.5 shows the i 2 c bus timing.
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 654 of 982 rej09b0054-0500 s sla r/ w a data a a/ a p 1111 n 7 1 m (a) i 2 c bus format (fs = 0 or fsx = 0) (b) i 2 c bus format (start condition retransmission, fs = 0 or fsx = 0) n: transfer bit count (n = 1 to 8) m: transfer frame count (m 1) s sla r/ w a data 111 n1 7 1 m1 s sla r/ w a data a/ a p 111 n2 7 1 m2 11 1 a/ a n1 and n2: transfer bit count (n1 and n2 = 1 to 8) m1 and m2: transfer frame count (m1 and m2 1) 11 figure 16.3 i 2 c bus data formats (i 2 c bus formats) s data data p 11 n 8 1 m fs = 1 and fsx = 1 n: transfer bit count (n = 1 to 8) m: transfer frame count (m 1) figure 16.4 i 2 c bus data format (serial format) sda scl s 1 to 7 sla 8 r/ w 9 a 1 to 7 data 8 9 1 to 7 8 9 a data p a/ a figure 16.5 i 2 c bus timing legend: s: start condition. the master device drives sda from high to low while scl is high sla: slave address r/ w : indicates the direction of data transfer: from the slave device to the master device when r/ w is 1, or from the master device to the slave device when r/ w is 0 a: acknowledge. the receiving device drives sda data: transferred data p: stop condition. the master device drives sda from low to high while scl is high
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 655 of 982 rej09b0054-0500 16.4.2 initial setting at startup the following procedure is used to initialize the iic. clear module stop. start initialization set iice = 1 (scrx) set ice = 0 (iccr) set sar and sarx set ice = 1 (iccr) set icsr set scrx set icmr set iccr set mstpb4 = 0 (iic0) mstpb3 = 0 (iic1) (mstpcrb) enable cpu access by iic control register and data register. enable sar and sarx access. set transfer format for 1st slave address, 2nd slave address, and iic (sva8 to sva0, fs, svax6 to svax0, fsx). enable imcr and imdr access. use scl and sda pins is iic port. set acknowledge bit (ackb). set transfer rate (iicx). set transfer format, wait insertion, and transfer rate (mls, wait, cks2 to cks0). set interrupt enable, transfer mode, and acknowledge judgment (ieic, mst, trs, acke). transmit/receive start figure 16.6 flowchart for iic initialization (example) note: the icmr register should be written to only after transmit or receive operations have completed. writing to the icmr register while a transmit or receive operation is in progress could cause an erroneous value to be written to bit counter bits bc2 to bc0. this could result in improper operation. 16.4.3 master transmit operation in i 2 c bus format master transmit mode, the master device outputs the transmit clock and transmit data, and the slave device returns an acknowledge signal.
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 656 of 982 rej09b0054-0500 figure 16.7 is a flowchart showing an example of the master transmit mode. start initial settings write bbsy = 1 and scp = 0 (iccr) bbsy = 0? yes yes yes yes yes yes yes no no no [1] initial settings. [2] determine status of scl and sda lines. [3] set to master transmit mode. [4] generate start condition. [5] wait for start condition to be met. [6] set 1st byte (slave address + r/ w ) transmit data. (perform icdr write and iric flag clear operations continuously.) [7] wait for end of 1 byte transmission. [8] judge acknowledge signal from specified. slave device. [9] set transmit data for 2nd byte onward. (perform icdr write and iric flag clear operations continuously.) [10] wait for end of 1 byte transmission. [11] judge end of transmission. [12] generate stop condition. set mst = 1 and trs = 1 (iccr) read iric flag in iccr read iric flag in iccr clear iric flag in iccr write transmit data to icdr read bbsy flag in iccr read ackb bit in icsr iric = 1? no no no iric = 1? transmit mode? ackb = 0? clear iric flag in iccr write transmit data to icdr read iric flag in iccr read ackb bit in icsr clear iric flag in iccr transmit complete? (ackb = 1?) no iric = 1? write bbsy = 0 and scp = 0 (iccr) write acke = 0 (iccr) (clear ackb = 0) end master receive mode figure 16.7 flowchart for master transmit mode (example)
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 657 of 982 rej09b0054-0500 the procedure for transmitting data sequentially, synchronized with icdr (icdrt) write operations, is described below. [1] perform initial settings as described in section 16.4.2, initial setting. [2] read the bbsy flag in iccr to confirm that the bus is free. [3] set bits mst and tsr in iccr to 1 to switch to the master transmit mode. [4] write 1 to bbsy and 0 to scp in iccr. this changes sda from high to low when scl is high, and generates the start condition. [5] the iric and irtr flags are set to 1 when the start condition is generated. if the ieic bit in iccr has been set to 1, an interrupt request is sent to the cpu. [6] after the start condition is detected, write the data (slave address + r/ w ) to icdr. with the i 2 c bus format (when the fs bit in sar or the fsx bit in sarx is 0), the first frame data following the start condition indicates the 7-bit slave address and transmit/receive direction (r/ w ). next, clear the iric flag to 0 to indicate the end of the transfer. continue successively writing to icdr and clearing the iric flag to ensure that processing of other interrupts does not intervene. if the time required to transmit one byte of data elapses by the time the iric flag is cleared, it will not be possible to determine the end of the transmission. the master device sequentially sends the transmit clock and the data written to icdr using the timing shown in figure 16.8. the selected slave device (i.e., the slave device with the matching slave address) drives sda low at the 9th transmit clock pulse and returns an acknowledge signal. [7] when one frame of data has been transmitted, the iric flag is set to 1 at the rise of the 9th transmit clock pulse. after one frame has been transmitted, scl is automatically fixed low in synchronization with the internal clock until the next transmit data is written. [8] read the ackb bit in icsr to confirm that its value is 0. if the slave device has not returned an acknowledge signal and the value of ackb is 1, perform the transmit end processing described in step [12] and then recommence the transmit operation from the beginning. [9] write the transmit data to icdr. next, clear the iric flag to 0 to indicate the end of the transfer. then continue successively writing to icdr and clearing the iric flag as described in step [6]. transmission of the next frame is synchronized with the internal clock. [10] when one frame of data has been transmitted, the iric flag is set to 1 at the rise of the 9th transmit clock pulse. after one frame has been transmitted, scl is automatically fixed low in synchronization with the internal clock until the next transmit data is written. [11] read the ackb bit in icsr to confirm that the slave device has returned an acknowledge signal and the value of ackb is 0. if the slave device has not returned an acknowledge signal and the value of ackb is 1, perform the transmit end processing described in step [12]. [12] clear the iric flag to 0. write 0 to bbsy and scp in iccr. this changes sda from low to high when scl is high, and generates the stop condition.
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 658 of 982 rej09b0054-0500 1 [5] r/ w [7] a 23456789 12 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bit 7 bit 6 data 1 data 1 data 1 slave address generate start condition interrupt request interrupt request address + r/ w address + r/ w [9] iric clearance [9] icdr write [6] iric clearance [6] icdr write [4] write bbsy = 1 and scp = 0 (generate start condition) scl (master output) sda (master output) sda (slave output) iric irtr icdrt icdrs user processing note: do not write data to icdr. figure 16.8 example of master transmit mode operation timing (mls = wait = 0) [7] [10] a a 123456789 generate start condition 89 scl (master output) sda (master output) sda (slave output) iric irtr icdr bit 7 bit 0 bit 6 data 2 data 2 data 1 data 1 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 [12] write bbsy = 0 and scp = 0 (generate stop condition) [12] iric clearance [11] ackb read [9] iric clearance [9] icdr write user processing figure 16.9 example of master transmit mode stop condition generation timing (mls = wait = 0)
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 659 of 982 rej09b0054-0500 16.4.4 master receive operation in i 2 c bus format master receive mode, the master device outputs the receive clock, receives data, and returns an acknowledge signal. the slave device transmits data. the master device transmits the data containing the slave address + r/ w (0: read) in the 1st frame after a start condition is generated in the master transmit mode. after the slave device is selected the switch to receive operation takes place. (1) receive operation using wait states figures 16.10 and 16.11 are flowcharts showing examples of the master receive mode (wait = 1).
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 660 of 982 rej09b0054-0500 set wait = 1 (icmr) clear iric flag in iccr set ackb = 0 (icsr) set trs = 0 (iccr) read icdr clear iric flag in iccr read iric flag in iccr irtr = 1? iric = 1? no no yes yes no yes yes no yes no [1] set to receive mode. [2] receive start, dummy read. [5] read receive data. [6] clear iric flag (cancel wait state). [7] set acknowledge data for final receive. [8] wait time until trs setting. [9] set trs to generate stop condition. [10] read receive data. [14] clear iric flag (cancel wait state). [16] read final receive data. [15] cancel wait mode clear iric flag. (iric flag should be cleared when wait = 0.) [17] generate stop condition. [13] data receive completed judgment. [12] receive wait state (iric set at falling edge of 8th clock cycle) or wait for end of reception of 1 byte (iric set at rising edge of 9th clock cycle). [3] receive wait state (iric set at falling edge of 8th clock cycle) or wait for end of reception of 1 byte (iric set at rising edge of 9th clock cycle). [4] data receive completed judgment. last receive? read icdr read icdr [11] clear iric flag (cancel wait state). clear iric flag in iccr set ackb = 1 (icsr) 1 clock cycle wait state set trs = 1 (iccr) read iric flag in iccr clear iric flag in iccr set wait = 0 (icmr) clear iric flag in iccr read icdr irtr = 1? iric = 1? write bbsy = 0 and scp = 0 (iccr) end master receive mode figure 16.10 flowchart for master receive mode (receiving multiple bytes) (wait = 1) (example)
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 661 of 982 rej09b0054-0500 set wait = 1 (icmr) clear iric flag in iccr set ackb = 0 (icsr) set trs = 0 (iccr) read icdr read iric flag in iccr iric = 1? no yes yes no [1] set to receive mode [2] receive start, dummy read. [7] set acknowledge data for final receive. [9] set trs to generate stop condition. [11] clear iric flag (cancel wait state). [16] read final receive data. [15] cancel wait mode clear iric flag. (iric flag should be cleared when wait = 0.) [17] generate stop condition. [12] wait for end of reception of 1 byte. (iric set at rising edge of 9th clock cycle) clear iric flag in iccr set ackb = 1 (icsr) set trs = 1 (iccr) read iric flag in iccr set wait = 0 (icmr) clear iric flag in iccr read icdr iric = 1? write bbsy = 0 and scp = 0 (iccr) end master receive mode [3] receive wait state (iric set at falling edge of 8th clock cycle) figure 16.11 flowchart for master receive mode (receiving 1 byte) (wait = 1) (example) the procedure for receiving data sequentially, using the wait states (wait bit) for synchronization with icdr (icdrr) read operations, is described below. the procedure below describes the operation for receiving multiple bytes. note that some of the steps are omitted when receiving only 1 byte. refer to figure 16.11 for details.
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 662 of 982 rej09b0054-0500 [1] clear the trs bit in iccr to 0 to switch from transmit mode to receive mode. clear the ackb bit in icsr to 0 (acknowledge data setting). clear the iric flag to 0, then set the wait bit in icmr to 1. [2] when icdr is read (dummy data read), reception is started, and the receive clock is output, and data received, in synchronization with the internal clock. [3] the iric flag is set to 1 by the following two conditions. at that point, an interrupt request is issued to the cpu if the ieic bit in iccr is set to 1. (1) the flag is set at the falling edge of the 8th clock cycle of the receive clock for 1 frame. scl is automatically held low, in synchronization with the internal clock, until the iric flag is cleared. (2) the flag is set at the rising edge of the 9th clock cycle of the receive clock for 1 frame. the irtr flag is set to 1, indicating that reception of 1 frame of data has ended. the master device continues to output the receive clock for the receive data. [4] read the irtr flag in icsr. if the irtr flag value is 0, the wait state is cancelled by clearing the iric flag as described in step [6] below. if the irtr flag value is 1 and the next receive data is the final receive data, perform the end processing described in step [7] below. [5] if the irtr flag value is 1, read the icdr receive data. [6] clear the iric flag to 0. the reading of the icdr flag described in step [5] and the clearing of the iric flag to 0 should be performed consecutively, with no interrupt processing occurring between them. during wait operation, clear the iric flag to 0 when the value of counter bc2 to bc0 is 2 or greater. if the iric flag is cleared to 0 when the value of counter bc2 to bc0 is 1 or 0, it will not be possible to determine when the transfer has completed. if condition [3]-1 is true, the master device drives sda to low level and returns an acknowledge signal when the receive clock outputs the 9th clock cycle. further data can be received by repeating steps [3] through [6]. [7] set the ackb bit in icsr to 1 to set the acknowledge data for the final receive. [8] wait for at least 1 clock cycle after the iric flag is set to 1 and then wait for the rising edge of the 1st clock cycle of the next receive data. [9] set the tsr bit in iccr to 1 to switch from the receive mode to the transmit mode. the tsr bit setting value at this point becomes valid when the rising edge of the next 9th clock cycle is input. [10] read the icdr receive data. [11] clear the iric flag to 0. as in step [6], read the icdr flag and clear the iric flag to 0 consecutively, with no interrupt processing occurring between them. during wait operation, clear the iric flag to 0 when the value of counter bc2 to bc0 is 2 or greater. [12] the iric flag is set to 1 by the following two conditions.
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 663 of 982 rej09b0054-0500 (1) the flag is set at the falling edge of the 8th clock cycle of the receive clock for 1 frame. scl is automatically held low, in synchronization with the internal clock, until the iric flag is cleared. (2) the flag is set at the rising edge of the 9th clock cycle of the receive clock for 1 frame. the irtr flag is set to 1, indicating that reception of 1 frame of data has ended. the master device continues to output the receive clock for the receive data. [13] read the irtr flag in icsr. if the irtr flag value is 0, the wait state is cancelled by clearing the iric flag as described in step [14] below. if the irtr flag value is 1 and the receive operation has finished, perform the issue stop condition processing described in step [15] below. [14] if the irtr flag value is 0, clear the iric flag to 0 to cancel the wait state. return to reading the iric flag, as described in step [12], to detect the end of the receive operation. [15] clear the wait bit in icmr to 0 to cancel the wait mode. then clear the iric flag to 0. the iric flag should be cleared when the value of wait is 0. (the stop condition may not be output properly when the issue stop condition instruction is executed if the wait bit was cleared to 0 after the iric flag is cleared to 0.) [16] read the final receive data in icdr. [17] write 0 to bbsy and scp in iccr. this changes sda from low to high when scl is high, and generates the stop condition. 1 9 a 2345 12345 678 9 data 1 data 1 master receive mode master transmit mode data 2 [3] [3] a [4] irtr = 1 [4] irtr = 0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 scl (master output) sda (slave output) sda (master output) iric irtr icdr user processing [1] trs cleared to 0 iric clearance [2] icdr read (dummy read) [6] iric clearance (cancel wait) [5] icdr read (data 1) [6] iric clearance figure 16.12 example of master receive mode operation timing (mls = ackb = 0, wait = 1)
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 664 of 982 rej09b0054-0500 9 82 1345678 9 a a data 2 data 3 data 3 data 2 data 1 [3] [3] [8] [12] [12] stop condition generated [4] irtr = 0 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bit 0 1 clock cycle wait time bit 7 [4] irtr = 1 [13] irtr = 1 [13] irtr = 0 [15] wait cleared to 0 iric clearance [14] iric clearance [11] iric clearance [6] iric clearance user processing [10] icdr read (data 2) [16] icdr read (data 3) [9] trs set to 1 [7] ackb set to 1 scl (master output) sda (slave output) sda (master output) iric irtr icdr [17] stop condition issued figure 16.13 example of master receive mode stop condition generation timing (mls = ackb = 0, wait = 1) 16.4.5 slave receive operation in slave receive mode, the master device outputs the transmit clock and transmit data, and the slave device returns an acknowledge signal. the slave device compares its own address with the slave address in the first frame following the establishment of the start condition issued by the master device. if the addresses match, the slave device operates as the slave device designated by the master device. figure 16.14 is a flowchart showing an example of slave receive mode operation.
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 665 of 982 rej09b0054-0500 start initialize set mst = 0 and trs = 0 in iccr set ackb = 0 in icsr read iric in iccr iric = 1? yes no clear iric in iccr read aas and adz in icsr aas = 1 and adz = 0? read trs in iccr trs = 0? no yes no yes yes no yes yes no no [1] [2] [3] [4] [5] [6] [7] [8] last receive? read icdr read iric in iccr iric = 1? clear iric in iccr set ackb = 0 in icsr read icdr read iric in iccr read icdr iric = 1? clear iric in iccr end general call address processing * description omitted slave transmit mode [1] select slave receive mode. [2] wait for the first byte to be received (slave address). [3] start receiving. the first read is a dummy read. [4] wait for the transfer to end. [5] set acknowledge data for the last receive. [6] start the last receive. [7] wait for the transfer to end. [8] read the last receive data. figure 16.14 flowchart for slave transmit mode (example)
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 666 of 982 rej09b0054-0500 the reception procedure and operations in slave receive mode are described below. [1] set the ice bit in iccr to 1. set the mls bit in icmr and the mst and trs bits in iccr according to the operating mode. [2] when the start condition output by the master device is detected, the bbsy flag in iccr is set to 1. [3] when the slave address matches in the first frame following the start condition, the device operates as the slave device specified by the master device. if the 8th data bit (r/ w ) is 0, the trs bit in iccr remains cleared to 0, and slave receive operation is performed. [4] at the 9th clock pulse of the receive frame, the slave device drives sda low and returns an acknowledge signal. at the same time, the iric flag in iccr is set to 1. if the ieic bit in iccr has been set to 1, an interrupt request is sent to the cpu. if the rdrf internal flag has been cleared to 0, it is set to 1, and the receive operation continues. if the rdrf internal flag has been set to 1, the slave device drives scl low from the fall of the receive clock until data is read into icdr. [5] read icdr and clear the iric flag in iccr to 0. the rdrf flag is cleared to 0. read the irdr flag and clear the iric flag to 0 consecutively, with no interrupt processing occurring between them. if the time needed to transmit one byte of data elapses before the iric flag is cleared, it will not be possible to determine when the transfer has completed. receive operations can be performed continuously by repeating steps [4] and [5]. when sda is changed from low to high when scl is high, and the stop condition is detected, the bbsy flag in iccr is cleared to 0.
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 667 of 982 rej09b0054-0500 sda (master output) sda (slave output) 2 1 2 1 4 36 58 79 bit 7 bit 6 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 iric icdrs icdrr rdrf scl (master output) start condition issuance scl (slave output) address + r/ w address + r/ w [5] icdr read [5] iric clearance user processing slave address data 1 [4] a r/ w figure 16.15 example of slave receive mode operation timing (1) (mls = ackb = 0)
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 668 of 982 rej09b0054-0500 sda (master output) sda (slave output) 2 14 36 58 79 8 79 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bit 1 bit 0 iric icdrs icdrr rdrf scl (master output) scl (slave output) data 2 data 2 data 1 data 1 [5] icdr read [5] iric clearance user processing data 2 data 1 [4] [4] a a figure 16.16 example of slave receive mode operation timing (2) (mls = ackb = 0)
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 669 of 982 rej09b0054-0500 16.4.6 slave transmit operation if the slave address matches to the address in the first frame (address reception frame) following the start condition detection when the 8th bit data (r/ w ) is 1 (read), the trs bit in iccr is automatically set to 1 and the mode changes to slave transmit mode. figure 16.17 shows the sample flowchart for the operations in slave transmit mode. end write transmit data in icdr clear iric in iccr clear iric in iccr clear acke to 0 in iccr (ackb = 0 clear) clear iric in iccr read iric in iccr read ackb in icsr set trs = 0 in iccr read icdr read iric in iccr iric = 1? yes yes no no iric = 1? yes no [8] set slave receive mode. [6] clear iric in iccr [7] clear acknowledge bit data [9] dummy read (to release the scl line). [10] wait for stop condition [3], [5] set transmit data for the second and subsequent bytes. [3], [4] wait for 1 byte to be transmitted. [4] determine end of transfer. slave transmit mode end of transmission (ackb = 1)? clear iric in iccr [1], [2] if the slave address matches to the address in the first frame following the start condition detection and the r/ w bit is 1 in slave recieve mode, the mode changes to slave transmit mode. figure 16.17 sample flowchart for slave transmit mode
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 670 of 982 rej09b0054-0500 in slave transmit mode, the slave device outputs the transmit data, while the master device outputs the receive clock and returns an acknowledge signal. the transmission procedure and operations in slave transmit mode are described below. 1. initialize slave receive mode and wait for slave address reception. 2. when the slave address matches in the first frame following detection of the start condition, the slave device drives sda low at the 9th clock pulse and returns an acknowledge signal. if the 8th data bit (r/ w ) is 1, the trs bit in iccr is set to 1, and the mode changes to slave transmit mode automatically. the iric flag is set to 1 at the rise of the 9th clock. if the ieic bit in iccr has been set to 1, an interrupt request is sent to the cpu. at the same time, the tdre internal flag is set to 1. the slave device drives scl low from the fall of the transmit 9th clock until icdr data is written, to disable the master device to output the next transfer clock. 3. after clearing the iric flag to 0, write data to icdr. at this time, the tdre internal flag is cleared to 0. the written data is transferred to icdrs, and the tdre internal flag and iric flag are set to 1 again. the slave device sequentially sends the data written into icdrs in accordance with the clock output by the master device. the iric flag is cleared to 0 to detect the end of transmission. processing from the icdr register writing to the iric flag clearing should be performed continuously. prevent any processing that includes interrupt processing during this period. if a duration sufficient for one byte of data to be transferred elapses before the iric flag is cleared, it will not be possible to determine that the transfer has completed. 4. the master device drives sda low at the 9th clock pulse, and returns an acknowledge signal. as this acknowledge signal is stored in the ackb bit in icsr, this bit can be used to determine whether the transfer operation was performed successfully. when one frame of data has been transmitted, the iric flag in iccr is set to 1 at the rise of the 9th transmit clock pulse. when the tdre internal flag is 0, the data written into icdr is transferred to icdrs, transmission starts, and the tdre internal flag and iric flag are set to 1 again. if the tdre internal flag has been set to 1, this slave device drives scl low from the fall of the 9th transmit clock until data is written to icdr. 5. to continue transmission, write the next data to be transmitted into icdr. the tdre internal flag is cleared to 0. the iric flag is cleared to 0 to detect the end of transmission. processing from the icdr writing to the iric flag clearing should be performed continuously. prevent any processing that includes interrupt processing during this period. transmit operations can be performed continuously by repeating steps [4] and [5]. 6. clear the iric flag to 0. 7. to end transmission, clear the acke bit in iccr to 0, to clear the acknowledge bit stored in the ackb bit to 0.
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 671 of 982 rej09b0054-0500 8. clear the trs bit to 0 for the next address reception, to set slave receive mode. 9. dummy-read icdr to release scl on the slave side. 10. when the stop condition is detected, that is, when sda is changed from low to high when scl is high, the bbsy flag in iccr is cleared to 0 and the stop flag in icsr is set to 1. at the same time, the iric flag is set to 1. if the iric flag has been set, it is cleared to 0. sda (master output) sda (slave output) 2 1 2 1 4 36 58 79 9 8 bit 7 bit 6 bit 5 bit 7 bit 6 bit 4 bit 3 bit 2 bit 1 bit 0 icdrt icdrs iric tdre scl (master output) scl (slave output) slave receive mode slave transmit mode [3] icdr write user processing data 1 data 1 data 2 data 1 data 2 data 2 a r/ w a [3] iric clearance [3] iric clearance [5] iric clearance [5] icdr write [2] [4] figure 16.18 example of slave transmit mode operation timing (mls = 0)
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 672 of 982 rej09b0054-0500 16.4.7 iric setting timing and scl control the interrupt request flag (iric) is set at different times depending on the wait bit in icmr, the fs bit in sar, and the fsx bit in sarx. if the tdre or rdrf internal flag is set to 1, scl is automatically held low after one frame has been transferred; this timing is synchronized with the internal clock. figure 16.19 shows the iric set timing and scl control. (a) when wait = 0, and fs = 0 or fsx = 0 (i 2 c bus format, no wait) scl sda iric user processing write to icdr (transmit) or read icdr (receive) clear iric clear iric clear iric 1 a 8 1 1 a 7 1 2 2 2 2 2 2 89 7 (b) when wait = 1, and fs = 0 or fsx = 0 (i 2 c bus format, wait inserted) scl sda iric user processing clear iric write to icdr (transmit) or read icdr (receive) scl sda iric user processing (c) when fs = 1 and fsx = 1 (synchronous serial format) write to icdr (transmit) or read icdr (receive) 8 89 8 7 1 8 7 1 figure 16.19 iric setting timing and scl control
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 673 of 982 rej09b0054-0500 16.4.8 operation using the dtc the i 2 c bus format provides for selection of the slave device and transfer direction by means of the slave address and the r/ w bit, confirmation of reception with acknowledge bit, indication of the last frame, and so on. therefore, continuous data transfer using the dtc must be carried out in conjunction cpu processing by means of interrupts. table 16.5 shows some example of processing using the dtc. these examples assume that the number of transfer data bytes is know in slave mode. table 16.5 flags and transfer states item master transmit mode master receive mode slave transmit mode slave receive mode slave address + r/ w bit transmission/ reception transmission by dtc (icdr write) transmission by cpu (icdr write) reception by cpu (icdr read) reception by cpu (icdr read) dummy data read ? processing by cpu (icdr read) ?? actual data transmission/rec eption transmission by dtc (icdr write) reception by dtc (icdr read) transmission by dtc (icdr write) reception by dtc (icdr read) dummy data (h'ff) write ?? processing by dtc (icdr write) ? last frame processing not necessary reception by cpu (icdr read) not necessary reception by cpu (icdr read) transfer request processing after last frame processing 1st time: clearing by cpu 2nd time: end condition issuance by cpu not necessary automatic clearing on detection of end condition during transmission of dummy data (h'ff) not necessary setting of number of dtc transfer data frames transmission: actual data count + 1 (+ 1 equivalent to slave address + r/ w bits) reception: actual data count transmission: actual data count + 1 (+ 1 equivalent to dummy data (h'ff)) reception: actual data count
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 674 of 982 rej09b0054-0500 16.4.9 noise canceler the logic levels at the scl and sda pins are routed through noise cancelers before being latched internally. figure 16.20 shows a block diagram of the noise canceler circuit. the noise canceler consists of two cascaded latches and a match detector. the scl (or sda) input signal is sampled on the system clock, but is not passed forward to the next circuit unless the outputs of both latches agree. if they do not agree, the previous value is held. system clock period sampling clock c dq latch c dq latch scl or sda input signal match detector internal scl or sda signal sampling clock figure 16.20 block diagram of noise canceler 16.4.10 initialization of internal state the iic has a function for forcible initialization of its internal state if a deadlock occurs during communication. initialization is executed by (1) setting bits clr3 to clr0 in the ddcswr register or (2) clearing the ice bit. for details of settings for bits clr3 to clr0, see section 16.3.8, ddc switch register (ddcswr). scope of initialization: the initialization executed by this function covers the following items: ? tdre and rdrf internal flags ? transmit/receive sequencer and internal operating clock counter ? internal latches for retaining the output state of the scl and sda pins (wait, clock, data output, etc.)
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 675 of 982 rej09b0054-0500 the following items are not initialized: ? actual register values (icdr, sar, sarx, icmr, iccr, icsr, ddcswr, and stcr) ? internal latches used to retain register read information for setting/clearing flags in the icmr, iccr, icsr, and ddcswr registers ? the value of the icmr register bit counter (bc2 to bc0) ? generated interrupt sources (interrupt sources transferred to the interrupt controller) notes on initialization: ? interrupt flags and interrupt sources are not cleared, and so flag clearing measures must be taken as necessary. ? basically, other register flags are not cleared either, and so flag clearing measures must be taken as necessary. ? when initialization is performed by means of the ddcswr register, the write data for bits clr3 to clr0 is not retained. to perform iic clearance, bits clr3 to clr0 must be written to simultaneously using an mov instruction. do not use a bit manipulation instruction such as bclr. similarly, when clearing is required again, all the bits must be written to simultaneously in accordance with the setting. ? if a flag clearing setting is made during transmission/reception, the iic module will stop transmitting/receiving at that point and the scl and sda pins will be released. when transmission/reception is started again, register initialization, etc., must be carried out as necessary to enable correct communication as a system. the value of the bbsy bit cannot be modified directly by this module clear function, but since the stop condition pin waveform is generated according to the state and release timing of the scl and sda pins, the bbsy bit may be cleared as a result. similarly, state switching of other bits and flags may also have an effect. to prevent problems caused by these factors, the following procedure should be used when initializing the iic state. 1. execute initialization of the internal state according to the setting of bits clr3 to clr0, or according to the ice bit. 2. execute a stop condition issuance instruction (write 0 to bbsy and scp) to clear the bbsy bit to 0, and wait for two transfer rate clock cycles. 3. re-execute initialization of the internal state according to the setting of bits clr3 to clr0, or according to the ice bit. 4. initialize (re-set) the iic registers.
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 676 of 982 rej09b0054-0500 16.5 interrupt source iici is the interrupt source of iic. table 16.6 shows each interrupt source and its priority. the iccr interrupt enable bit sets each interrupt and the setting is independently sent to the interrupt controller. table 16.6 iic interrupt source channel name enable bit interrupt source interrupt flag interrupt priority 0 iici0 ieic i 2 c bus interface interrupt request iric high 1 iici1 ieic i 2 c bus interface interrupt request iric low 16.6 usage notes 1. in master mode, if an instruction to generate a start condition is issued and then an instruction to generate a stop condition is issued before the start condition is output to the i 2 c bus, neither condition will be output correctly. to output the start condition followed by the stop condition, after issuing the instruction that generates the start condition, read port in each i 2 c bus output pin, and check that scl and sda are both low. even if the ice bit is set to 1, it is possible to monitor the pin state by reading the port register so long as the ddr i/o port register corresponding to the pin has been cleared to 0. then issue the instruction that generates the stop condition. note that scl may not yet have gone low when bbsy is cleared to 0. 2. either of the following two conditions will start the next transfer. pay attention to these conditions when reading or writing to icdr. ? write access to icdr when ice = 1 and trs = 1 (including automatic transfer from icdrt to icdrs) ? read access to icdr when ice = 1 and trs = 0 (including automatic transfer from icdrs to icdrr) 3. table 16.7 shows the timing of scl and sda output in synchronization with the internal clock. timings on the bus are determined by the rise and fall times of signals affected by the bus load capacitance, series resistance, and parallel resistance.
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 677 of 982 rej09b0054-0500 table 16.7 i 2 c bus timing (scl and sda output) item symbol output timing unit notes scl output cycle time t sclo 28 t cyc to 256 t cyc ns scl output high pulse width t sclho 0.5 t sclo ns scl output low pulse width t scllo 0.5 t sclo ns sda output bus free time t bufo 0.5 t sclo ? 1 t cyc ns start condition output hold time t staho 0.5 t sclo ? 1 t cyc ns retransmission start condition output setup time t staso 1 t sclo ns stop condition output setup time t stoso 0.5 t sclo + 2 t cyc ns data output setup time (master) t sdaso 1 t scllo ? 3 t cyc ns data output setup time (slave) * 1 1 t scll ? 3 t cyc ns data output setup time (slave) * 2 1 t scll ? (6 t cyc or 12 t cyc ) * 3 ns data output hold time t sdaho 3 t cyc ns figure 27.31 notes: 1. not supported by the h8s/2258 group. 2. supported only by the h8s/2258 group. 3. 6 t cyc when iicx is 0, 12 t cyc when iicx is 1. 4. scl and sda inputs are sampled in synchronization with the internal clock. the ac timing therefore depends on the system clock cycle t cyc , as shown in table 27.22 (h8s/2239 group) and table 27.34 (h8s/2238b and h8s/2236b). note that the i 2 c bus interface ac timing specifications will not be met with a system clock frequency of less than 5 mhz. 5. the i 2 c bus interface specification for the scl rise time t sr is under 1000 ns (300 ns for high- speed mode). in master mode, the i 2 c bus interface monitors the scl line and synchronizes one bit at a time during communication. if t sr (the time for scl to go from low to v ih ) exceeds the time determined by the input clock of the i 2 c bus interface, the high period of scl is extended. the scl rise time is determined by the pull-up resistance and load capacitance of the scl line. to insure proper operation at the set transfer rate, adjust the pull-up resistance and load capacitance so that the scl rise time does not exceed the values given in the table in table 16.8.
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 678 of 982 rej09b0054-0500 table 16.8 permissible scl rise time (t sr ) values time indication iicx t cyc indication i 2 c bus specification (max) = 5 mhz * 2 = 8 mhz * 2 = 10 mhz = 16 mhz * 1 = 20 mhz * 1 0 7.5 t cyc normal mode 1000 ns 1000 ns 937 ns 750 ns 468 ns 375 ns high-speed mode 300 ns 300 ns 300 ns 300 ns 300 ns 300 ns 1 17.5 t cyc normal mode 1000 ns 1000 ns 1000 ns 1000 ns 1000 ns 875 ns high-speed mode 300 ns 300 ns 300 ns 300 ns 300 ns 300 ns notes: 1. supported only by the h8s/2239 group. 2. the h8s/2258 group is out of operation. 6. the i 2 c bus interface specifications for the scl and sda rise and fall times are under 1000 ns and 300 ns. the i 2 c bus interface scl and sda output timing is prescribed by t cyc , as shown in table 16.7. however, because of the rise and fall times, the i 2 c bus interface specifications may not be satisfied at the maximum transfer rate. table 16.9 shows output timing calculations for different operating frequencies, including the worst-case influence of rise and fall times. the values in the above table will vary depending on the settings of the iicx bit and bits cks0 to cks2. depending on the frequency it may not be possible to achieve the maximum transfer rate; therefore, whether or not the i 2 c bus interface specifications are met must be determined in accordance with the actual setting conditions. t bufo fails to meet the i 2 c bus interface specifications at any frequency. the solution is either (a) to provide coding to secure the necessary interval (approximately 1 s) between issuance of a stop condition and issuance of a start condition, or (b) to select devices whose input timing permits this output timing for use as slave devices connected to the i 2 c bus. t scllo in high-speed mode and t staso in standard mode fail to satisfy the i 2 c bus interface specifications for worst-case calculations of t sr /t sf . possible solutions that should be investigated include (a) adjusting the rise and fall times by means of a pull-up resistor and capacitive load, (b) reducing the transfer rate to meet the specifications, or (c) selecting devices whose input timing permits this output timing for use as slave devices connected to the i 2 c bus.
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 679 of 982 rej09b0054-0500 table 16.9 i 2 c bus timing (with maximum influence of t sr /t sf ) time indication (at maximum transfer rate) [ns] item t cyc indication t sr /t sf influence (max) i 2 c bus specifi- ation (min) = 5 mhz * 7 = 8 mhz * 7 = 10 mhz = 16 mhz * 3 = 20 mhz * 3 t sclho 0.5t sclo (?t sr ) standard mode ?1000 4000 4000 4000 4000 4000 4000 high-speed mode ?300 600 950 950 950 950 950 t scllo 0.5t sclo (?t sf ) standard mode ?250 4700 4750 4750 4750 4750 4750 high-speed mode ?250 1300 1000 * 1 1000 * 1 1000 * 1 1000 * 1 1000 * 1 t bufo standard mode ?1000 4700 3800 * 1 3875 * 1 3900 * 1 3938 * 1 3950 * 1 0.5t sclo ?1t cyc ( ?t sr ) high-speed mode ?300 1300 750 * 1 825 * 1 850 * 1 888 * 1 900 * 1 t staho standard mode ?250 4000 4550 4625 4650 4688 4700 0.5t sclo ?1t cyc (?t sf ) high-speed mode ?250 600 800 875 900 938 950 t staso 1t sclo (?t sr ) standard mode ?1000 4700 9000 9000 9000 9000 9000 high-speed mode ?300 600 2200 2200 2200 2200 2200 t stoso standard mode ?1000 4000 4400 4250 4200 4125 4100 0.5t sclo + 2t cyc (?t sr ) high-speed mode ?300 600 1350 1200 1150 1075 1050 standard mode ?1000 250 3100 3325 3400 3513 3550 t sdaso (master) 1t scllo * 2 ?3t cyc (?t sr ) high-speed mode ?300 100 400 625 700 813 850 standard mode ?1000 250 3100 3325 3400 3513 3550 t sdaso (slave) * 4 1t scll * 2 ?3t cyc (?t sr ) high-speed mode ?300 100 400 625 700 813 850 standard mode ?1000 250 ? ? 2500 ? ? t sdaso (slave) * 5 1t scll * 2 ?12t cyc * 6 (?t sr ) high-speed mode ?300 100 ? ? ?200 * 1 ?? t sdaho 3t cyc standard mode 0 0 600 375 300 188 150 high-speed mode 0 0 600 375 300 188 150 notes: 1. does not meet the i 2 c bus interface specification. remedial action such as the following is necessary: (a) secure a start/stop condition issuance interval; (b)adjust the rise and fall times by means of a pull-up resistor and capacitive load; (c) reduce the transfer rate; (d) select slave devices whose input timing permits this output timing. the values in the above table will vary depending on the settings of the iicx bit and bits cks0 to cks2.depending on the frequency it may not be possible to achieve the maximum transfer rate; therefore, whether or not the i 2 c bus interface specifications are met must be determined in accordance with the actual setting conditions. 2. calculated using the i 2 c bus specification values (standard mode: 4700 ns min; high- speed mode: 1300 ns min). 3. supported only by the h8s/2239 group. 4. not supported by the h8s/2258 group. 5. supported only by the h8s/2258 group.
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 680 of 982 rej09b0054-0500 6. value when the iicx bit is set to 1. when the iicx bit is cleared to 0, the value is 6t cyc . 7. the h8s/2258 group is out of operation. 7. note on icdr read at end of master reception to halt reception after completion of a receive operation in master receive mode, set the trs bit to 1 and write 0 to bbsy and scp in iccr. this changes the sda pin from low to high when the scl pin is high, and generates the stop condition. after this, receive data can be read by means of an icdr read, but if data remains in the buffer the icdrs receive data will not be transferred to icdr, and so it will not be possible to read the second byte of data. if it is necessary to read the second byte of data, issue the stop condition in master receive mode (i.e. with the trs bit cleared to 0). when reading the receive data, first confirm that the bbsy bit in iccr is cleared to 0, the stop condition has been generated, and the bus has been released, then read icdr with trs cleared to 0. note that if the receive data (icdr data) is read in the interval between execution of the instruction for issuance of the stop condition (writing of 0 to bbsy and scp in iccr) and the actual generation of the stop condition, the clock may not be output correctly in subsequent master transmission. clearing of the mst bit after completion of master transmission/reception, or other modifications of iic control bits to change the transmit/receive operating mode or settings, must be carried out during interval (a) in figure 16.21 (after confirming that the bbsy bit has been cleared to 0 in the iccr register). sda scl internal clock bbsy bit master receive mode icdr reading prohibited bit 0 a 8 9 stop condition (a) start condition execution of stop condition issuance instruction (0 written to bbsy and scp) confirmation of stop condition generation (0 read from bbsy) start condition issuance figure 16.21 points for attention concerning reading of master receive data
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 681 of 982 rej09b0054-0500 8. notes on start condition issuance for retransmission depending on the timing combination with the start condition issuance and the subsequently writing data to icdr, it may not be possible to issue the retransmission and the data transmission after retransmission condition issuance. after start condition issuance is done and determined the start condition, write the transmit data to icdr, as shown below. figure 16.22 shows the timing of start condition issuance for retransmission, and the timing for subsequently writing data to icdr, together with the corresponding flowchart. sda iric scl ack bit 7 data output [3] (restart) start condition instruction issuance [4] iric determination [5] icdr write (next transmit data) [2] detemination of scl = low [1] iric determination start condition (retransmission) iric = 1? yes clear iric in icsr read scl pin write transmit data to icdr write bbsy = 1, scp = 0 (icsr) [1] [1] wait for end of 1-byte transfer [2] determine whether scl is low [3] issue restart condition instruction for transmission [4] determine whether start condition is generated or not [5] set transmit data (slave address + r/ w ) [2] [3] [4] [5] yes yes no no iric = 1? yes scl = low? start condition issuance? no no other processing note: program so that processing from [3] to [5] is executed continuously. 9 figure 16.22 flowchart and timing of start condition instruction issuance for retransmission
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 682 of 982 rej09b0054-0500 9. notes on i 2 c bus interface stop condition instruction issuance if the rise time of the 9th scl acknowledge exceeds the specification because the bus load capacitance is large, or if there is a slave device of the type that drives scl low to effect a wait, issue the stop condition instruction after reading scl and determining it to be low, as shown below. stop condition scl iric [1] determination of scl = low 9th clock vih high period secured [2] stop condition instruction issuance sda as waveform rise is late, scl is detected as low figure 16.23 timing of stop condition issuance 10. notes on iric flag clearance when using wait function if the scl rise time exceeds the designated duration or if the slave device is of the type that keeps scl low and applies a wait state when the wait function is used in the master mode of the i 2 c bus interface, read scl and clear the iric flag after determining that scl has gone low, as shown below. clearing the iric flag to 0 when wait is set to 1 and scl is being held at high level can cause the sda value to change before scl goes low, resulting in a start condition or stop condition being generated erroneously. scl scl = high duration maintained [1] judgement that scl = low [2] iric clearance v ih sda iric scl = low detected figure 16.24 iric flag clearance in wait = 1 status
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 683 of 982 rej09b0054-0500 11. notes on icdr reads and iccr access in slave transmit mode in a transmit operation in the slave mode of the i 2 c bus interface, do not read the icdr register or read or write to the iccr register during the period indicated by the shaded portion in figure 16.25. normally, when interrupt processing is triggered in synchronization with the rising edge of the 9th clock cycle, the period in question has already elapsed when the transition to interrupt processing takes place, so there is no problem with reading the icdr register or reading or writing to the iccr register. to ensure that the interrupt processing is performed properly, one of the following two conditions should be applied. (1) make sure that reading received data from the icdr register, or reading or writing to the iccr register, is completed before the next slave address receive operation starts. (2) monitor the bc2 to bc0 counter in the icmr register and, when the value of bc2 to bc0 is 000 (8th or 9th clock cycle), allow a waiting time of at least 2 transfer clock cycles in order to involve the problem period in question before reading from the icdr register, or reading or writing to the iccr register. sda r/w waveforms if problem occurs bit 7 icdr write data transmission period when icdr reads and iccr reads and writes are prohibited (6 system clock cycles) detection of 9th clock cycle rising edge a 89 scl trs bit address received figure 16.25 icdr read and iccr access timing in slave transmit mode
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 684 of 982 rej09b0054-0500 12. notes on trs bit setting in slave mode from the detection of the rising edge of the 9th clock cycle or of a stop condition to when the rising edge of the next scl pin signal is detected (the period indicated as (a) in figure 16.26) in the slave mode of the i 2 c bus interface, the value set in the trs bit in the iccr register is effective immediately. however, at other times (indicated as (b) in figure 16.26) the value set in the trs bit is put on hold until the next rising edge of the 9th clock cycle or stop condition is detected, rather than taking effect immediately. this results in the actual internal value of the trs bit remaining 1 (transmit mode) and no acknowledge bit being sent at the 9th clock cycle address receive completion in the case of an address receive operation following a restart condition input with no stop condition intervening. when receiving an address in the slave mode, clear the trs bit to 0 during the period indicated as (a) in figure 16.26. to cancel the holding of the scl bit low by the wait function in the slave mode, clear the trs bit to 0 and then perform a dummy read of the icdr register. (a) restart condition icdr dummy read detection of 9th clock cycle rising edge trs bit set detection of 9th clock cycle rising edge 89 (b) data transmission sda scl trs bit 123456789 a address reception trs bit setting hold time figure 16.26 trs bit setting timing in slave mode
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 685 of 982 rej09b0054-0500 13. notes on icdr reads in transmit mode and icdr writes in receive mode when attempting to read icdr in the transmit mode (trs = 1) or write to icdr in the receive mode (trs = 0) under certain conditions, the scl pin may not be held low after the completion of the transmit or receive operation and a clock may not be output to the scl bus line before the icdr register access operation can take place properly. when accessing icdr, always change the setting to the transmit mode before performing a read operation, and always change the setting to the receive mode before performing a write operation. 14. notes on acke bit and trs bit in slave mode when using the i 2 c bus interface, if an address is received in the slave mode immediately after 1 is received as an acknowledge bit (ackb = 1) in the transmit mode (trs = 1), an interrupt may be generated at the rising edge of the 9th clock cycle if the address does not match. when performing slave mode operations using the iic bus interface module, make sure to do the following. (1) when a 1 is received as an acknowledge bit for the final transmit data after completing a series of transmit operations, clear the acke bit in the iccr register to 0 to initialize the ackb bit to 0. (2) in the slave mode, change the setting to the receive mode (trs = 0) before the start condition is input. to ensure that the switch from the slave transmit mode to the slave receive mode is accomplished properly, end the transmission as described in figure 16.17. 15. notes on arbitration lost in master mode the i 2 c bus interface recognizes the data in transmit/receive frame as an address when arbitration is lost in master mode and a transition to slave receive mode is automatically carried out. when arbitration is lost not in the first frame but in the second frame or subsequent frame, transmit/receive data that is not an address is compared with the value set in the sar or sarx register as an address. if the receive data matches with the address in the sar or sarx register, the i 2 c bus interface erroneously recognizes that the address call has occurred. (see figure 16.27.) in multi-master mode, a bus conflict could happen. when the i 2 c bus interface is operated in master mode, check the state of the al bit in the icsr register every time after one frame of data has been transmitted or received. when arbitration is lost during transmitting the second frame or subsequent frame, take avoidance measures.
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 686 of 982 rej09b0054-0500 sa sla r/ w sa sla r/ w a data2 sa sla r/ w a sla r/ w a data3 a data4 data1 i 2 c bus interface (master transmit mode) transmit data match transmit timing match  receive address is ignored  automatically transferred to slave receive mode  receive data is recognized as an address  when the receive data matches to the address set in the sar or sarx register, the i 2 c bus interface operates as a slave device.  arbitration is lost  the al flag in icsr is set to 1 transmit data does not match other device (master transmit mode) i 2 c bus interface (slave receive mode) data contention figure 16.27 diagram of erroneous operation wen arbitration is lost though it is prohibited in the normal i 2 c protocol, the same problem may occur when the mst bit is erroneously set to 1 and a transition to master mode is occurred during data transmission or reception in slave mode. in multi-master mode, pay attention to the setting of the mst bit when a bus conflict may occur. in this case, the mst bit in the iccr register should be set to 1 according to the order below. (1) make sure that the bbsy flag in the iccr register is 0 and the bus is free before setting the mst bit. (2) set the mst bit to 1. (3) to confirm that the bus was not entered to the busy state while the mst bit is being set, check that the bbsy flag in the iccr register is 0 immediately after the mst bit has been set. 16. note on wait operation in master mode when the interrupt request flag (iric) is cleared from 1 to 0 between the falling edge of the 7th clock and the falling edge of the 8th clock in master mode using the wait function, a wait may not be inserted after the falling edge of the 8th clock and 9th clock pulse may be output continuously. when using the wait operation, note the following to clear the iric flag. after the iric flag is set to 1 at the rising edge of the 9th clock, clear the iric falg before the rising edge of the 7th clock (when the value of the bc2 to bc0 counter is 2 or more). if the clearing of the iric flag is deleyed due to interrupt handling etc. and the value of the bc counter reaches 1 or 0, confirm that the scl pin is low and then clear the iric flag after the bc2 to bc0 counter reaches 0 (see figure 16.28).
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 687 of 982 rej09b0054-0500 scl bc2 to bc0 transmit data a sda 7 6 5 4 3 2 1 0 7 6 5 1 2 3 4 5 6 7 8 9 1 2 3 0 iric flag can not be cleared iric flag can be cleared iric flag can be cleared 9 a iric (sampling example) confirm scl = l iric clear iric clear when bc2 to bc0 2 transmit data figure 16.28 iric flag clearing timing in wait operation 17. interrupt during module stop mode when the module is stopped in the state that an interrupt is requested, the interrupt source of the cpu or activation source of the dtc is not cleared. be sure to enter module stop mode by disabling the interrupt beforehand. 16.6.1 module stop mode setting iic operation can be disabled or enabled using the module stop control register. the initial setting is for iic operation to be halted. register access is enabled by clearing module stop mode. for details, refer to section 24, power-down modes.
section 16 i 2 c bus interface (iic) (option) rev. 5.00 aug 08, 2006 page 688 of 982 rej09b0054-0500
section 17 a/d converter rev. 5.00 aug 08, 2006 page 689 of 982 rej09b0054-0500 section 17 a/d converter this lsi includes a successive approximation type 10-bit a/d converter that allows up to eight analog input channels to be selected. a block diagram of the a/d converter is shown in figure 17.1. 17.1 features ? 10-bit resolution ? eight input channels ? conversion time: 9.6 s per channel (at 13.5 mhz operation) ? two operating modes single mode: single-channel a/d conversion scan mode: continuous a/d conversion on 1 to 4 channels ? four data registers conversion results are held in a 16-bit data register for each channel ? sample and hold function ? three methods conversion start software timer (tpu or 8-bit timer) conversion start trigger external trigger signal ? interrupt request an a/d conversion end interrupt request (adi) can be generated ? module stop mode can be set ? selectable range voltages of analog inputs the range of voltages of analog inputs to be converted can be specified using the v ref signal as the analog reference voltage. adcms35c_000020020700
section 17 a/d converter rev. 5.00 aug 08, 2006 page 690 of 982 rej09b0054-0500 module data bus control circuit internal data bus 10-bit d/a comparator off during a/d conversion wait time, on during a/d conversion. + sample-and- hold circuit adi interrupt bus interface successive approximations register multiplexer adcsr adcr addrd addrc an0 an1 an2 an3 an4 an5 an6 an7 legend: adcr: a/d control register adcsr: a/d control/status register addra: a/d data register a addrb: a/d data register b addrc: a/d data register c addrd: a/d data register d adtrg conversion start trigger from tpu or 8-bit timer /2 /4 /8 /16 av cc av ss vref addra addrb figure 17.1 block diagram of a/d converter
section 17 a/d converter rev. 5.00 aug 08, 2006 page 691 of 982 rej09b0054-0500 17.2 input/output pins table 17.1 summarizes the input pins used by the a/d converter. the eight analog input pins are divided into two groups each of which consists of four channels; analog input pins 0 to 3 (an0 to an3) comprising group 0 and analog input pins 4 to 7 (an4 to an7) comprising group 1. the avcc and avss pins are the power supply pins for the analog block in the a/d converter. the vref pin is the a/d conversion reference voltage pin. table 17.1 pin configuration pin name symbol i/o function analog power supply pin av cc input analog block power supply and reference voltage analog ground pin av ss input analog block ground and reference voltage reference voltage pin vref input reference voltage for a/d conversion analog input pin 0 an0 input analog input pin 1 an1 input analog input pin 2 an2 input analog input pin 3 an3 input group 0 analog input pins analog input pin 4 an4 input analog input pin 5 an5 input analog input pin 6 an6 input analog input pin 7 an7 input group 1 analog input pins a/d external trigger input pin adtrg input external trigger input pin for starting a/d conversion
section 17 a/d converter rev. 5.00 aug 08, 2006 page 692 of 982 rej09b0054-0500 17.3 register descriptions the a/d converter has the following registers. for details on the module stop control register, refer to section 24.1.2, module stop control registers a to c (mstpcra to mstpcrc). ? a/d data register a (addra) ? a/d data register b (addrb) ? a/d data register c (addrc) ? a/d data register d (addrd) ? a/d control/status register (adcsr) ? a/d control register (adcr) 17.3.1 a/d data registers a to d (addra to addrd) there are four 16-bit read-only addr registers; addra to addrd, used to store the results of a/d conversion. the addr registers, which store a conversion result for each channel, are shown in table 17.2. the converted 10-bit data is stored in bits 6 to 15. the lower 6 bits are always read as 0. the data bus between the cpu and the a/d converter is 8 bits wide. the upper byte can be read directly from the cpu, however the lower byte should be read via a temporary register. therefore, when reading the addr, read only the upper byte, or read in word unit. table 17.2 analog input channels and corresponding addr registers analog input channel group 0 (ch2 = 0) group 1 (ch2 = 1) a/d data register to be stored the results of a/d conversion an0 an4 addra an1 an5 addrb an2 an6 addrc an3 an7 addrd
section 17 a/d converter rev. 5.00 aug 08, 2006 page 693 of 982 rej09b0054-0500 17.3.2 a/d control/status register (adcsr) adcsr controls a/d conversion operations. bit bit name initial value r/w description 7adf 0 r/(w) * a/d end flag a status flag that indicates the end of a/d conversion. [setting conditions] ? when a/d conversion ends in single mode ? when a/d conversion ends on all specified channels in scan mode [clearing conditions] ? when 0 is written after reading adf = 1 ? when the data transfer controller (dtc) is activated by an adi interrupt and disel in dtc is 0 with the transfer counter not being 0 6 adie 0 r/w a/d interrupt enable a/d conversion end interrupt (adi) request enabled when 1 is set 5 adst 0 r/w a/d start clearing this bit to 0 stops a/d conversion, and the a/d converter enters the wait state. setting this bit to 1 starts a/d conversion. in single mode, this bit is cleared to 0 automatically when conversion on the specified channel is complete. in scan mode, conversion continues sequentially on the specified channels until this bit is cleared to 0 by software, a reset, software standby mode, hardware standby mode, or module stop mode. the adst bit can be set to 1 by software, a timer conversion start trigger, or the a/d external trigger input pin ( adtrg ).
section 17 a/d converter rev. 5.00 aug 08, 2006 page 694 of 982 rej09b0054-0500 bit bit name initial value r/w description 4 scan 0 r/w scan mode selects single mode or scan mode as the a/d conversion operating mode. only set the scan bit while conversion is stopped (adst = 0). 0: single mode 1: scan mode 3 ? 0r/wreserved this bit is always read as 0. the write value should always be 0. 2 1 0 ch2 ch1 ch0 0 0 0 r/w r/w r/w channel select 2 to 0 select analog input channels. when scan = 0 when scan = 1 000: an0 000: an0 001: an1 001: an0 and an1 010: an2 010: an0 to an2 011: an3 011: an0 to an3 100: an4 100: an4 101: an5 101: an4 and an5 110: an6 110: an4 to an6 111: an7 111: an4 to an7 note: * only 0 can be written to clear this bit.
section 17 a/d converter rev. 5.00 aug 08, 2006 page 695 of 982 rej09b0054-0500 17.3.3 a/d control register (adcr) the adcr enables a/d conversion started by an external trigger signal. bit bit name initial value r/w description 7 6 trgs1 trgs0 0 0 r/w r/w timer trigger select 1 and 0 enables the start of a/d conversion by a trigger signal. only set bits trgs0 and trgs1 while conversion is stopped (adst = 0). 00: a/d conversion start by software is enabled 01: a/d conversion start by tpu conversion start trigger is enabled 10: a/d conversion start by 8-bit timer conversion start trigger is enabled 11: a/d conversion start by external trigger pin ( adtrg ) is enabled 5, 4 ? all 1 ? reserved these bits are always read as 1 and cannot be modified. 3 2 cks1 cks0 0 0 r/w r/w clock select 1 and 0 these bits specify the a/d conversion time. the conversion time should be changed only when adst = 0. specify a setting that gives a value within the range shown in table 27.10 (h8s/2258 group), table 27.23 (h8s/2239 group), table 27.35 (h8s/2238b and h8s/ 2236b), table 27.47 (h8s/2238r and h8s/ 2236r), or table 27.57 (h8s/2237 group and h8s/2227 group). 00: conversion time = 530 states (max) 01: conversion time = 266 states (max) 10: conversion time = 134 states (max) 11: conversion time = 68 states (max) 1, 0 ? all 1 ? reserved these bits are always read as 1 and cannot be modified.
section 17 a/d converter rev. 5.00 aug 08, 2006 page 696 of 982 rej09b0054-0500 17.4 interface to bus master addra to addrd are 16-bit registers. as the data bus to the bus master is 8 bits wide, the bus master accesses to the upper byte of the registers directly while to the lower byte of the registers via the temporary register (temp). data in addr is read in the following way: when the upper-byte data is read, the upper-byte data will be transferred to the cpu and the lower-byte data will be transferred to temp. then, when the lower-byte data is read, the lower-byte data will be transferred to the cpu. when data in addr is read, the data should be read from the upper byte and lower byte in the order. when only the upper-byte data is read, the data is guaranteed. however, when only the lower-byte data is read, the data is not guaranteed. figure 17.2 shows data flow when accessing to addr. temp (h'40) addrnl (h'40) addrnh (h'aa) temp (h'40) addrnl (h'40) addrnh (h'aa) read the upper byte read the lower byte (n = a to d) (n = a to d) module data bus module data bus bus interface bus interface bus master (h'40) bus master (h'aa) figure 17.2 access to addr (when reading h ' aa40)
section 17 a/d converter rev. 5.00 aug 08, 2006 page 697 of 982 rej09b0054-0500 17.5 operation the a/d converter operates by successive approximation with 10-bit resolution. it has two operating modes; single mode and scan mode. when changing the operating mode or analog input channel, in order to prevent incorrect operation, first clear the bit adst to 0 in adcsr. the adst bit can be set at the same time as the operating mode or analog input channel is changed. 17.5.1 single mode in single mode, a/d conversion is to be performed only once on the specified single channel. the operations are as follows. 1. a/d conversion is started when the adst bit is set to 1, according to software, timer conversion start trigger, or external trigger input. 2. when a/d conversion is completed, the result is transferred to the corresponding a/d data register to the channel. 3. on completion of conversion, the adf bit in adcsr is set to 1. if the adie bit is set to 1 at this time, an adi interrupt request is generated. 4. the adst bit remains set to 1 during a/d conversion. when a/d conversion ends, the adst bit is automatically cleared to 0 and the a/d converter enters the wait state.
section 17 a/d converter rev. 5.00 aug 08, 2006 page 698 of 982 rej09b0054-0500 adie adst adf state of channel 0 (an0) a/d conversion result 2 a/d conversion start a/d conversion result 1 addra addrb addrc addrd state of channel 1 (an1) state of channel 2 (an2) state of channel 3 (an3) note: * a/d conversion 1 set * set * set * clear * clear * idle idle idle idle a/d conversion 2 idle idle read conversion result * read conversion result * vertical arrows indicate instructions executed by software. figure 17.3 example of a/d converter operation (single mode, channel 1 selected) 17.5.2 scan mode in scan mode, a/d conversion is to be performed sequentially on the specified channels (four channels maximum). the operations are as follows. 1. when the adst bit is set to 1 by software, tpu, timer conversion start trigger, or external trigger, input, a/d conversion starts on the first channel in the group (an0 when ch2 = 0, an4 when ch2 = 1). 2. when a/d conversion for each channel is completed, the result is sequentially transferred to the a/d data register corresponding to each channel. 3. when conversion of all the selected channels is completed, the adf flag is set to 1. if the adie bit is set to 1 at this time, an adi interrupt is requested after a/d conversion ends. conversion of the first channel in the group starts again. 4. steps 2 to 3 are repeated as long as the adst bit remains set to 1. when the adst bit is cleared to 0, a/d conversion stops and the a/d converter enters the wait state.
section 17 a/d converter rev. 5.00 aug 08, 2006 page 699 of 982 rej09b0054-0500 adst adf addra addrb addrc addrd state of channel 0 (an0) notes: continuous a/d conversion state of channel 1 (an1) state of channel 3 (an3) state of channel 2 (an2) clear * 1 clear * 1 set * 1 idle idle idle idle idle idle idle idle idle a/d conversion time a/d conversion 1 a/d conversion 2 a/d conversion 4 a/d conversion 3 a/d conversion 5 * 2 a/d conversion result 1 a/d conversion result 4 a/d conversion result 2 a/d conversion result 3 1. vertical arrows indicate instructions executed by software. 2. data currently being converted is ignored. figure 17.4 example of a/d converter operation (scan mode, channels an0 to an2 selected) 17.5.3 input sampling and a/d conversion time the a/d converter has a built-in sample-and-hold circuit. the a/d converter samples the analog input when the a/d conversion start delay time (t d ) has passed after the adst bit is set to 1, then starts conversion. figure 17.5 shows the a/d conversion timing. table 17.3 shows the a/d conversion time. as indicated in figure 17.5, the a/d conversion time (t conv ) includes t d and the input sampling time (t spl ). the length of t d varies depending on the timing of the write access to adcsr. the total conversion time therefore varies within the ranges indicated in table 17.3. in scan mode, the values given in table 17.3 apply to the first conversion time. the values given in table 17.4 apply to the second and subsequent conversions.
section 17 a/d converter rev. 5.00 aug 08, 2006 page 700 of 982 rej09b0054-0500 (1) (2) t d t spl t conv address write signal input sampling timing adf legend: (1): adcsr write cycle (2): adcsr address t d : a/d conversion start delay t spl : input sampling time t conv : a/d conversion time figure 17.5 a/d conversion timing table 17.3 a/d conversion time (single mode) cks1 = 0 cks1 = 1 cks0 = 0 cks0 = 1 cks0 = 0 cks0 = 1 item symbol min typ max min typ max min typ max min typ max a/d conversion start delay t d 18 ? 33 10 ? 17 6 ? 9 4 ? 5 input sampling time t spl ? 127 ? ? 63 ? ? 31 ? ? 15 ? a/d conversion time t conv 515 ? 530 259 ? 266 131 ? 134 67 ? 68 note: all values represent the number of states. table 17.4 a/d conversion time (scan mode) cks1 cks0 conversion time (state) 0 512 (fixed) 0 1 256 (fixed) 0 128 (fixed) 1 1 64 (fixed)
section 17 a/d converter rev. 5.00 aug 08, 2006 page 701 of 982 rej09b0054-0500 17.5.4 external trigger input timing a/d conversion can be externally triggered. when the trgs0 and trgs1 bits are set to 11 in adcr, external trigger input is enabled at the adtrg pin. a falling edge at the adtrg pin sets the adst bit to 1 in adcsr, starting a/d conversion. other operations, in both single and scan modes, are the same as when the bit adst has been set to 1 by software. figure 17.6 shows the timing. adtrg internal trigger signal adst a/d conversion figure 17.6 external trigger input timing 17.6 interrupt source the a/d converter generates an a/d conversion end interrupt (adi) at the end of a/d conversion. setting the adie bit to 1 enables adi interrupt requests while the bit adf in adcsr is set to 1 after a/d conversion is completed. the dmac* and the dtc can be activated by an adi interrupt. having the converted data read by the dmac* or the dtc in response to an adi interrupt enables continuous conversion without imposing a load on software. note: * supported only by the h8s/2239 group. table 17.5 a/d converter interrupt source name interrupt source interrupt source flag dtc activation dmac * activation adi a/d conversion completed adf possible possible note: * supported only by the h8s/2239 group.
section 17 a/d converter rev. 5.00 aug 08, 2006 page 702 of 982 rej09b0054-0500 17.7 a/d conversion accuracy definitions this lsi?s a/d conversion accuracy definitions are given below. ? resolution the number of a/d converter digital output codes. ? quantization error the deviation inherent in the a/d converter, given by 1/2 lsb (see figure 17.7). ? offset error the deviation of the analog input voltage value from the ideal a/d conversion characteristic when the digital output changes from the minimum voltage value b'0000000000 (h'000) to b'0000000001 (h'001) (see figure 17.8). ? full-scale error the deviation of the analog input voltage value from the ideal a/d conversion characteristic when the digital output changes from b'1111111110 (h'3fe) to b'1111111111 (h'3ff) (see figure 17.8). ? nonlinearity error the error with respect to the ideal a/d conversion characteristic between zero voltage and full- scale voltage. does not include offset error, full-scale error, or quantization error (see figure 17.8). ? absolute accuracy the deviation between the digital value and the analog input value. includes offset error, full- scale error, quantization error, and nonlinearity error.
section 17 a/d converter rev. 5.00 aug 08, 2006 page 703 of 982 rej09b0054-0500 111 110 101 100 011 010 001 000 1 1024 2 1024 1022 1024 1023 1024 fs quantization error digital output ideal a/d conversion characteristic analog input voltage figure 17.7 a/d conversion accuracy definitions fs digital output ideal a/d conversion characteristic nonlinearity error analog input voltage offset error actual a/d conversion characteristic full-scale error figure 17.8 a/d conversion accuracy definitions
section 17 a/d converter rev. 5.00 aug 08, 2006 page 704 of 982 rej09b0054-0500 17.8 usage notes 17.8.1 module stop mode setting operation of the a/d converter can be disabled or enabled using the module stop control register. the initial setting is for operation of the a/d converter to be halted. register access is enabled by clearing module stop mode. for details, refer to section 24, power-down modes. 17.8.2 permissible signal source impedance this lsi?s analog input is designed such that conversion accuracy is guaranteed for an input signal for which the signal source impedance is 5 k ? or less. this specification is provided to enable the a/d converter?s sample-and-hold circuit input capacitance to be charged within the sampling time; if the sensor output impedance exceeds 5 k ? , charging may be insufficient and it may not be possible to guarantee a/d conversion accuracy. however, for a/d conversion in single mode with a large capacitance provided externally, the input load will essentially comprise only the internal input resistance of 10 k ? , and the signal source impedance is ignored. however, as a low-pass filter effect is obtained in this case, it may not be possible to follow an analog signal with a large differential coefficient (e.g., 5 mv/ s or greater) (see figure 17.9). when converting a high-speed analog signal, a low-impedance buffer should be inserted. 17.8.3 influences on absolute accuracy adding capacitance results in coupling with gnd, and therefore noise in gnd may adversely affect absolute accuracy. be sure to make the connection to an electrically stable gnd such as avss. care is also required to insure that filter circuits do not communicate with digital signals on the mounting board (i.e., acting as antennas). a/d converter equivalent circuit this lsi 20 pf c in = 15 pf 10 k ? low-pass filter c to 0.1 f sensor output impedance to 5 k ? sensor input figure 17.9 example of analog input circuit
section 17 a/d converter rev. 5.00 aug 08, 2006 page 705 of 982 rej09b0054-0500 17.8.4 range of analog power supply and other pin settings if the conditions below are not met, the reliability of the device may be adversely affected. ? analog input voltage range the voltage applied to analog input pin ann during a/d conversion should be in the range avss ann avcc. ? relationship between avcc, avss and vcc, vss set avss = vss as the relationship between avcc, avss and vcc, vss. if the a/d converter is not used, the avcc and avss pins must not be left open. ? vref range the reference voltage input from the vref pin should be set to avcc or less. 17.8.5 notes on board design in board design, digital circuitry and analog circuitry should be as mutually isolated as possible, and layout in which digital circuit signal lines and analog circuit signal lines cross or are in close proximity should be avoided as far as possible. failure to do so may result in incorrect operation of the analog circuitry due to inductance, adversely affecting a/d conversion values. also, digital circuitry must be isolated from the analog input signals (an0 to an7), and analog power supply (avcc) by the analog ground (avss). also, the analog ground (avss) should be connected at one point to a stable digital ground (vss) on the board. 17.8.6 notes on noise countermeasures a protection circuit should be connected in order to prevent damage due to abnormal voltage, such as an excessive surge at the analog input pins (an0 to an7), between avcc and avss, as shown in figure 17.10. also, the bypass capacitors connected to avcc and the filter capacitor connected to an0 to an7 must be connected to avss. if a filter capacitor is connected, the input currents at the analog input pins (an0 to an7) are averaged, and so an error may arise. also, when a/d conversion is performed frequently, as in scan mode, if the current charged and discharged by the capacitance of the sample-and-hold circuit in the a/d converter exceeds the current input via the input impedance (r in ), an error will arise in the analog input pin voltage. careful consideration is therefore required when deciding circuit constants.
section 17 a/d converter rev. 5.00 aug 08, 2006 page 706 of 982 rej09b0054-0500 avcc * 1 an0 to an7 avss r in * 2 100 ? 0.1 f 0.01 f 10 f notes: values are reference values. 1. 2. r in : input impedance vref * 1 figure 17.10 example of analog input protection circuit table 17.6 analog pin specifications item min max unit analog input capacitance ? 20 pf permissible signal source impedance ? 5 k ? 20 pf an0 to an7 note: values are reference values. 10 k ? to a/d converter figure 17.11 analog input pin equivalent circuit
section 18 d/a converter rev. 5.00 aug 08, 2006 page 707 of 982 rej09b0054-0500 section 18 d/a converter 18.1 features ? 8-bit resolution ? two output channels ? conversion time: 10 s, maximum (when load capacitance is 20 pf) ? output voltage: 0 v to vref ? module stop mode can be set note: the d/a converter is not included in the h8s/2227 group. module data bus internal data bus bus interface vref avcc da1 da0 avss 8-bit d/a control circuit legend: dacr: d/a control register dadr0: d/a data register 0 dadr1: d/a data register 1 dadr0 dadr1 dacr figure 18.1 block diagram of d/a converter dac0004c_000020020700
section 18 d/a converter rev. 5.00 aug 08, 2006 page 708 of 982 rej09b0054-0500 18.2 input/output pins table 18.1 shows the pin configuration for the d/a converter. table 18.1 pin configuration pin name symbol i/o function analog power supply pin av cc input analog block power supply analog ground pin av ss input analog block ground and reference voltage analog output pin 0 da0 output channel 0 analog output pin analog output pin 1 da1 output channel 1 analog output pin reference voltage pin vref input reference voltage for analog block 18.3 register description the d/a converter has the following registers. for details on the module stop control register, refer to section 24.1.2, module stop control registers a to c (mstpcra to mstpcrc). ? d/a data register 0 (dadr0) ? d/a data register 1 (dadr1) ? d/a control register (dacr) 18.3.1 d/a data registers 0 and 1 (dadr0 and dadr1) dadr0 and dadr1 are 8-bit readable/writable registers that store data for d/a conversion. when analog output is permitted, d/a data register contents are converted and output to analog output pins.
section 18 d/a converter rev. 5.00 aug 08, 2006 page 709 of 982 rej09b0054-0500 18.3.2 d/a control register (dacr) dacr controls d/a converter operation. bit bit name initial value r/w description 7 daoe1 0 r/w d/a output enable 1 controls d/a conversion and analog output 0: analog output da1 is disabled 1: d/a conversion for channel 1 and analog output da1 are enabled 6 daoe0 0 r/w d/a output enable 0 controls d/a conversion and analog output 0: analog output da0 is disabled 1: d/a conversion for channel 0 and analog output da0 are enabled 5 dae 0 r/w d/a enable controls d/a conversion in conjunction with the daoe0 and daoe1 bits. when the dae bit is cleared to 0, d/a conversion for channels 0 and 1 are controlled individually. when dae is set to 1, d/a conversion for channels 0 and 1 are controlled as one. conversion result output is controlled by the daoe0 and daoe1 bits. for details, see table 18.2. 4 to 0 ? all 1 ? reserved these bits are always read as 1 and cannot be modified. table 18.2 d/a conversion control bit 5 bit 7 bit 6 dae daoe1 daoe0 description 000disables d/a conversion 1 enables d/a conversion for channel 0 1 0 enables d/a conversion for channel 1 1 enables d/a conversion for channels 0 and 1 100disables d/a conversion 1 enables d/a conversion for channels 0 and 1 10 1
section 18 d/a converter rev. 5.00 aug 08, 2006 page 710 of 982 rej09b0054-0500 18.4 operation two channels of the d/a converter can perform conversion individually. when the daoe bit in dacr is set to 1, d/a conversion is enabled and the conversion results are output. an example of d/a conversion of channel 0 is shown below. the operation timing is shown in figure 18.2. 1. write conversion data to dadr0. 2. when the daoe0 bit in dacr is set to 1, d/a conversion starts. after the interval of t dconv , the conversion results are output from the analog output pin da0. the conversion results are output continuously until dadr0 is modified or daoe0 bit is cleared to 0. the output value is calculated by the following formula: (dadr contents) / 256 vref 3. conversion starts immediately after dadr0 is modified. after the interval of t dconv , conversion results are output. 4. when the daoe bit is cleared to 0, analog output is disabled. dadr0 write cycle dacr write cycle dadr0 write cycle dacr write cycle address dadr0 daoe0 da0 conversion data (1) conversion data (2) high impedance state conversion result (1) conversion result (2) t dconv t dconv legend: t dconv : d/a conversion time figure 18.2 d/a converter operation example
section 18 d/a converter rev. 5.00 aug 08, 2006 page 711 of 982 rej09b0054-0500 18.5 usage notes 18.5.1 analog power supply current in power-down mode if this lsi enters a power-down mode such as software standby, watch, subactive, subsleep, and module stop modes while d/a conversion is enabled, the d/a cannot retain analog outputs within the given d/a absolute accuracy* although it retains digital values. the analog power supply current is approximately the same as that during d/a conversion. to reduce analog power supply current in power-down mode, clear the daoe0, daoe1 and dae bits to 0 to disable d/a outputs before entering the mode. note: * the h8s/2258 group, h8s/2238b, and h8s/2236b satisfy the specified d/a absolute accuracy. 18.5.2 setting for module stop mode it is possible to enable/disable the d/a converter operation using the module stop control register, the d/a converter does not operate by the initial value of the register. the register can be accessed by releasing the module stop mode. for more details, see section 24, power-down modes.
section 18 d/a converter rev. 5.00 aug 08, 2006 page 712 of 982 rej09b0054-0500
section 19 ram rev. 5.00 aug 08, 2006 page 713 of 982 rej09b0054-0500 section 19 ram the h8s/2239 has 32 kbytes of on-chip high-speed static ram. the h8s/2258, h8s/2238b, h8s/2238r, h8s/2237, and h8s/2227 have 16 kbytes of on-chip high-speed static ram. the h8s/2256, h8s/2236b, h8s/2236r have 8 kbytes of on-chip high-speed static ram. the h8s/2235, h8s/2233, h8s/2225, h8s/2224, and h8s/2223 have 4 kbytes of on-chip high-speed static ram. the ram is connected to the cpu by a 16-bit data bus, enabling one-state access by the cpu to both byte data and word data.
section 19 ram rev. 5.00 aug 08, 2006 page 714 of 982 rej09b0054-0500
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 715 of 982 rej09b0054-0500 section 20 flash memory (f-ztat version) the features of the flash memory are summarized below. the block diagram of the flash memory is shown in figure 20.1. 20.1 features ? capacity h8s/2239: 384 kbytes h8s/2258: 256 kbytes h8s/2238b: 256 kbytes h8s/2238r: 256 kbytes h8s/2227: 128 kbytes ? programming/erase methods the flash memory is programmed 128 bytes at a time. erase is performed in single-block units. the flash memory of the h8s/2239 is configured as follows: 64 kbytes 5 blocks, 32 kbytes 1 block, and 4 kbytes 8 blocks. the flash memory of the h8s/2258, h8s/2238b, and h8s/2238r is configured as follows: 64 kbytes 3 blocks, 32 kbytes 1 block, and 4 kbytes 8 blocks. the flash memory of the h8s/2227 is configured as follows: 32 kbytes 2 blocks, 28 kbytes 1 block, 16 kbytes 1 block, 8 kbytes 2 blocks, and 1 kbyte 4 blocks. to erase the entire flash memory, each block must be erased in turn. ? reprogramming capability the flash memory can be reprogrammed for 100 times. ? two programming modes boot mode user program mode on-board programming/erasing can be done in boot mode, in which the boot program built into the chip is started to erase or program of the entire flash memory. in normal user program mode, individual blocks can be erased or programmed. ? automatic bit rate adjustment for data transfer in boot mode, this lsi?s bit rate can be automatically adjusted to match the transfer bit rate of the host. ? programming/erasing protection there are three protect modes, hardware, software, and error protect, which allow protected status to be designated for flash memory program/erase operations.
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 716 of 982 rej09b0054-0500 ? programmer mode flash memory can be programmed/erased in programmer mode using a prom programmer, as well as in on-board programming mode. ? emulation function for flash memory in ram the real-time emulation for programming of flash memory is possible by overlapping the flash memory to a part of ram. module bus bus interface/controller h8s/2239 h8s/2258 h8s/2238b h8s/2238r h8s/2227 operating mode flmcr2 internal address bus internal data bus (16 bits) fwe pin mode pin ebr1 ebr2 ramer flmcr1 flash memory control register 1 flash memory control register 2 erase block register 1 erase block register 2 ram emulation register legend: flmcr1: flmcr2: ebr1: ebr2: ramer: flpwcr: flash memory power control register flpwcr flash memory : 384 kbytes : 256 kbytes : 256 kbytes : 256 kbytes : 128 kbytes figure 20.1 block diagram of flash memory 20.2 mode transitions when the mode pins and the fwe pin are set in the reset state and a reset-start is executed, this lsi enters an operating mode as shown in figure 20.2. in user mode, flash memory can be read but not programmed or erased. the boot, user program and programmer modes are provided as modes to write and erase the flash memory.
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 717 of 982 rej09b0054-0500 the differences between boot mode and user program mode are shown in table 20.1. figure 20.3 shows the operation flow for boot mode and figure 20.4 shows that for user program mode. boot mode on-board programming mode user program mode user mode reset state programmer mode res = 0 fwe = 1 fwe = 0 * 1 notes: only make a transition between user mode and user program mode when the cpu is not accessing the flash memory. 1. ram emulation possible 2. in the h8s/2258, h8s/2239, h8s/2238b, and h8s/2238r, md0 = 0, md1 = 0, md2 = 0, p14 = 0, p16 = 0, pf0 = 1. 3. in the h8s/2227 group, md0 = 0, md1 = 0, md2 = 0, p14 = 0, p16 = 0, pf0 = 1, pf3 = 1. res = 0 md1 = 1, md2 = 0, fwe = 1 res = 0 res = 0 md1 = 1, md2 = 1, fwe = 0 * 1 md1 = 1, md2 = 1, fwe = 1 * 2 * 3 figure 20.2 flash memory state transitions table 20.1 differences between boot mode and user program mode boot mode user program mode total erase yes yes block erase no yes programming control program * program/program-verify program/program-verify/erase/ erase-verify/emulation note: * to be provided by the user, in accordance with the recommended algorithm.
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 718 of 982 rej09b0054-0500 flash memory this lsi ram host programming control program sci application program (old version) new application program flash memory this lsi ram host sci application program (old version) boot program area new application program flash memory this lsi ram host sci flash memory preprogramming erase boot program new application program flash memory this lsi program execution state ram host sci new application program boot program programming control program 1. initial state the old program version or data remains written in the flash memory. the user should prepare the programming control program and new application program beforehand in the host. 2. programming control program transfer when boot mode is entered, the boot program in this lsi (originally incorporated in the chip) is started and the programming control program in the host is transferred to ram via sci communication. the boot program required for flash memory erasing is automatically transferred to the ram boot program area. 3. flash memory initialization the erase program in the boot program area (in ram) is executed, and the flash memory is initialized (to h'ff). in boot mode, total flash memory erasure is performed, without regard to blocks. 4. writing new application program the programming control program transferred from the host to ram is executed, and the new application program in the host is written into the flash memory. programming control program boot program boot program boot program area boot program area programming control program figure 20.3 boot mode (example)
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 719 of 982 rej09b0054-0500 flash memory this lsi ram host programming/ erase control program sci boot program new application program flash memory this lsi ram host sci new application program flash memory this lsi ram host sci flash memory erase boot program new application program flash memory this lsi program execution state ram host sci boot program boot program fwe assessment program application program (old version) new application program 1. initial state the fwe assessment program that confirms that user program mode has been entered, and the program that will transfer the programming/erase control program from flash memory to on-chip ram should be written into the flash memory by the user beforehand. the programming/erase control program should be prepared in the host or in the flash memory. 2. programming/erase control program transfer when user program mode is entered, user software confirms this fact, executes transfer program in the flash memory, and transfers the programming/erase control program to ram. 3. flash memory initialization the programming/erase program in ram is executed, and the flash memory is initialized (to h'ff). erasing can be performed in block units, but not in byte units. 4. writing new application program next, the new application program in the host is written into the erased flash memory blocks. do not write to unerased blocks. programming/ erase control program programming/ erase control program programming/ erase control program transfer program application program (old version) transfer program fwe assessment program fwe assessment program transfer program fwe assessment program transfer program figure 20.4 user program mode (example)
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 720 of 982 rej09b0054-0500 20.3 block configuration figure 20.5 shows the block configuration of 384-kbyte flash memory. figure 20.6 shows the block configuration of 256-kbyte flash memory. figure 20.7 shows the block configuration of 128-kbyte flash memory. the thick lines indicate erasing units, the narrow lines indicate programming units, and the values are addresses. the 384-kbyte flash memory is divided into 4 kbytes (8 blocks), 32 kbytes (1 block), and 64 kbytes (5 blocks). the 256-kbyte flash memory is divided into 4 kbytes (8 blocks), 32 kbytes (1 block), and 64 kbytes (3 blocks). the 128-kbyte flash memory is divided into 1 kbyte (4 blocks), 16 kbytes (1 block), 28 kbytes (1 block), 8 kbytes (2 blocks), and 32 kbytes (2 blocks). erasing is performed in these units. programming is performed in 128-byte units starting from an address with lower eight bits h'00 or h'80.
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 721 of 982 rej09b0054-0500 eb0 erase unit 4 kbytes eb1 erase unit 4 kbytes eb2 erase unit 4 kbytes eb3 erase unit 4 kbytes eb4 erase unit 4 kbytes eb5 erase unit 4 kbytes eb6 erase unit 4 kbytes eb7 erase unit 4 kbytes eb8 erase unit 32 kbytes eb9 erase unit 64 kbytes h'000000 h'000001 h'000002 h'00007f h'000fff h'00107f h'00207f h'00307f h'00407f h'004fff h'00507f h'005fff h'001fff h'002fff h'003fff h'01ffff h'00607f h'006fff h'00707f h'007fff h'00807f h'00ffff h'01007f h'001000 h'001001 h'001002 h'002000 h'002001 h'002002 h'003000 h'003001 h'003002 h'004000 h'004001 h'004002 h'005000 h'005001 h'005002 h'006000 h'006001 h'006002 h'007000 h'007001 h'007002 h'008000 h'008001 h'008002 h'010000 h'010001 h'010002 programming unit: 128 bytes programming unit: 128 bytes eb10 erase unit 64 kbytes h'02007f h'02ffff h'020000 h'020001 h'020002 programming unit: 128 bytes eb11 erase unit 64 kbytes h'03007f h'05ffff h'030000 h'030001 h'030002 programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes eb12 erase unit 64 kbytes h'04007f h'04ffff h'040000 h'040001 h'040002 programming unit: 128 bytes eb13 erase unit 64 kbytes h'05007f h'03ffff h'050000 h'050001 h'050002 programming unit: 128 bytes figure 20.5 block configuration of 384-kbyte flash memory
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 722 of 982 rej09b0054-0500 eb0 erase unit 4 kbytes eb1 erase unit 4 kbytes eb2 erase unit 4 kbytes eb3 erase unit 4 kbytes eb4 erase unit 4 kbytes eb5 erase unit 4 kbytes eb6 erase unit 4 kbytes eb7 erase unit 4 kbytes eb8 erase unit 32 kbytes eb9 erase unit 64 kbytes h'000000 h'000001 h'000002 h'00007f h'000fff h'00107f h'00207f h'00307f h'00407f h'004fff h'00507f h'005fff h'001fff h'002fff h'003fff h'01ffff h'00607f h'006fff h'00707f h'007fff h'00807f h'00ffff h'01007f h'001000 h'001001 h'001002 h'002000 h'002001 h'002002 h'003000 h'003001 h'003002 h'004000 h'004001 h'004002 h'005000 h'005001 h'005002 h'006000 h'006001 h'006002 h'007000 h'007001 h'007002 h'008000 h'008001 h'008002 h'010000 h'010001 h'010002 programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes eb10 erase unit 64 kbytes eb11 erase unit 64 kbytes h'03ffff h'02007f h'02ffff h'03007f h'020000 h'020001 h'020002 h'030000 h'030001 h'030002 programming unit: 128 bytes programming unit: 128 bytes figure 20.6 block configuration of 256-kbyte flash memory
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 723 of 982 rej09b0054-0500 eb0 erase unit 1 kbyte eb1 erase unit 1 kbyte eb2 erase unit 1 kbyte eb3 erase unit 1 kbyte eb4 erase unit 28 kbytes eb5 erase unit 16 kbytes eb6 erase unit 8 kbytes eb7 erase unit 8 kbytes eb8 erase unit 32 kbytes eb9 erase unit 32 kbytes h'000000 h'000001 h'000002 h'000380 h'000381 h'000382 h'000780 h'000781 h'000782 h'00007f h'0003ff h'00047f h'00087f h'000c7f h'00107f h'007fff h'00807f h'00bfff h'0007ff h'000bff h'000fff h'01ffff h'00c07f h'00dfff h'00e07f h'00ffff h'01007f h'017fff h'01807f h'000400 h'000401 h'000402 h'000800 h'000801 h'000802 h'000b80 h'000b81 h'000b82 h'000c00 h'000c01 h'000c02 h'000f80 h'000f81 h'000f82 h'001000 h'001001 h'001002 h'007f80 h'007f81 h'007f82 h'008000 h'008001 h'008002 h'00bf80 h'00bf81 h'00bf82 h'00c000 h'00c001 h'00c002 h'00df80 h'00df81 h'00df82 h'00e000 h'00e001 h'00e002 h'00ff80 h'00ff81 h'00ff82 h'01ff80 h'01ff81 h'01ff82 h'017f80 h'017f81 h'017f82 h'010000 h'010001 h'010002 h'018000 h'018001 h'018002 programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes programming unit: 128 bytes figure 20.7 block configuration of 128-kbyte flash memory
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 724 of 982 rej09b0054-0500 20.4 input/output pins the flash memory is controlled by means of the pins shown in table 20.2. table 20.2 pin configuration pin name i/o function res input reset fwe input flash program/erase protection by hardware md2 input sets this lsi?s operating mode md1 input sets this lsi?s operating mode md0 input sets this lsi?s operating mode pf0 input sets mcu operating mode in programmer mode p16 input sets mcu operating mode in programmer mode p14 input sets mcu operating mode in programmer mode txd * output serial transmit data output rxd * input serial receive data input note: * sci_2 (txd2, rxd2) is used for the h8s/2258, h8s/2239, h8s/2238b, and h8s/2238r, and sci_0 (txd0, rxd0) for the h8s/2227. 20.5 register descriptions the flash memory has the following registers. ? flash memory control register 1 (flmcr1) ? flash memory control register 2 (flmcr2) ? erase block register 1 (ebr1) ? erase block register 2 (ebr2) ? ram emulation register (ramer) ? flash memory power control register (flpwcr) ? serial control register x (scrx) the registers described above are not present in the masked rom version. if a register described above is read in the masked rom version, an undefined value will be returned.
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 725 of 982 rej09b0054-0500 20.5.1 flash memory control register 1 (flmcr1) flmcr1 is a register that makes the flash memory change to program mode, program-verify mode, erase mode, or erase-verify mode. for details on register setting, refer to section 20.8, flash memory programming/erasing. bit bit name initial value r/w description 7 fwe ? r flash write enable bit reflects the input level at the fwe pin. it is set to 1 when a low level is input to the fwe pin, and cleared to 0 when a high level is input. when this bit is cleared to 0, the flash memory changes to hardware protect mode. 6 swe1 0 r/w software write enable bit when this bit is set to 1, flash memory programming/erasing is enabled. when this bit is cleared to 0, bits 5 to 0 in flmcr1 register and all ebr1 and ebr2 bits cannot be set. [setting condition] when fwe = 1 5 esu1 0 r/w erase setup bit when this bit is set to 1, the flash memory changes to the erase setup state. when it is cleared to 0, the erase setup state is cancelled. set this bit to 1 before setting the e1 bit in flmcr1. [setting condition] when fwe = 1 and swe1 = 1 4 psu1 0 r/w program setup bit when this bit is set to 1, the flash memory changes to the program setup state. when it is cleared to 0, the program setup state is cancelled. set this bit to 1 before setting the p1 bit in flmcr1. [setting condition] when fwe = 1 and swe1 = 1 3 ev1 0 r/w erase-verify when this bit is set to 1, the flash memory changes to erase-verify mode. when it is cleared to 0, erase-verify mode is cancelled. [setting condition] when fwe = 1 and swe1 = 1
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 726 of 982 rej09b0054-0500 bit bit name initial value r/w description 2 pv1 0 r/w program-verify when this bit is set to 1, the flash memory changes to program-verify mode. when it is cleared to 0, program- verify mode is cancelled. [setting condition] when fwe = 1 and swe1 = 1 1e1 0 r/werase when this bit is set to 1, and while the swe1 and esu1 bits are 1, the flash memory changes to erase mode. when it is cleared to 0, erase mode is cancelled. [setting condition] when fwe = 1, swe1 = 1, and esu1 = 1 0 p1 0 r/w program when this bit is set to 1, and while the swe1 and psu1 bits are 1, the flash memory changes to program mode. when it is cleared to 0, program mode is cancelled. when fwe = 1, swe1 = 1, and psu1 = 1 20.5.2 flash memory control register 2 (flmcr2) flmcr2 is a register that displays the state of flash memory programming/erasing. flmcr2 is a read-only register, and should not be written to. bit bit name initial value r/w description 7 fler 0 r indicates that an error has occurred during an operation on flash memory (programming or erasing). when fler is set to 1, flash memory goes to the error-protection state. see section 20.9.3, error protection, for details. 6 to 0 ? all 0 r reserved these bits are always read as 0. 20.5.3 erase block register 1 (ebr1) ebr1 specifies the flash memory erase area block. ebr1 is initialized to h'00 when the swe1 bit in flmcr1 is 0. do not set more than one bit at a time, as this will cause all the bits in ebr1 and ebr2 to be automatically cleared to 0.
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 727 of 982 rej09b0054-0500 ? 384-kbyte or 256-kbyte flash memory bit bit name initial value r/w description 7 eb7 0 r/w when this bit is set to 1, 4 kbytes of eb7 (h'007000 to h'007fff) will be erased. 6 eb6 0 r/w when this bit is set to 1, 4 kbytes of eb6 (h'006000 to h'006fff) will be erased. 5 eb5 0 r/w when this bit is set to 1, 4 kbytes of eb5 (h'005000 to h'005fff) will be erased. 4 eb4 0 r/w when this bit is set to 1, 4 kbytes of eb4 (h'004000 to h'004fff) will be erased. 3 eb3 0 r/w when this bit is set to 1, 4 kbytes of eb3 (h'003000 to h'003fff) will be erased. 2 eb2 0 r/w when this bit is set to 1, 4 kbytes of eb2 (h'002000 to h'002fff) will be erased. 1 eb1 0 r/w when this bit is set to 1, 4 kbytes of eb1 (h'001000 to h'001fff) will be erased. 0 eb0 0 r/w when this bit is set to 1, 4 kbytes of eb0 (h'000000 to h'000fff) will be erased. ? 128-kbyte flash memory bit bit name initial value r/w description 7 eb7 0 r/w when this bit is set to 1, 8 kbytes of eb7 (h'00e000 to h'00ffff) will be erased. 6 eb6 0 r/w when this bit is set to 1, 8 kbytes of eb6 (h'00c000 to h'00dfff) will be erased. 5 eb5 0 r/w when this bit is set to 1, 16 kbytes of eb5 (h'008000 to h'00bfff) will be erased. 4 eb4 0 r/w when this bit is set to 1, 28 kbytes of eb4 (h'001000 to h'007fff) will be erased. 3 eb3 0 r/w when this bit is set to 1, 1 kbyte of eb3 (h'000c00 to h'000fff) will be erased. 2 eb2 0 r/w when this bit is set to 1, 1 kbyte of eb2 (h'000800 to h'000bff) will be erased. 1 eb1 0 r/w when this bit is set to 1, 1 kbyte of eb1 (h'000400 to h'0007ff) will be erased. 0 eb0 0 r/w when this bit is set to 1, 1 kbyte of eb0 (h'000000 to h'0003ff) will be erased.
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 728 of 982 rej09b0054-0500 20.5.4 erase block register 2 (ebr2) ebr2 specifies the flash memory erase area block. ebr1 is initialized to h'00 when the swe1 bit in flmcr1 is 0. do not set more than one bit at a time, as this will cause all the bits in ebr1 and ebr2 to be automatically cleared to 0. ? 384-kbyte flash memory bit bit name initial value r/w description 7, 6 ? all 0 r/w reserved these bits are always read as 0. the write value should always be 0. 5 eb13 0 r/w when this bit is set to 1, 64 kbytes of eb13 (h'050000 to h'05ffff) will be erased. 4 eb12 0 r/w when this bit is 1, 64 kbytes of eb12 (h'040000 to h'04ffff) will be erased. 3 eb11 0 r/w when this bit is set to 1, 64 kbytes of eb11 (h'030000 to h'03ffff) will be erased. 2 eb10 0 r/w when this bit is set to 1, 64 kbytes of eb10 (h'020000 to h'02ffff) will be erased. 1 eb9 0 r/w when this bit is set to 1, 64 kbytes of eb9 (h'010000 to h'01ffff) will be erased. 0 eb8 0 r/w when this bit is set to 1, 32 kbytes of eb8 (h'008000 to h'00ffff) will be erased. ? 256-kbyte flash memory bit bit name initial value r/w description 7 to 4 ? all 0 r/(w) reserved initial values should not be changed. 3 eb11 0 r/w when this bit is set to 1, 64 kbytes of eb11 (h'030000 to h'03ffff) will be erased. 2 eb10 0 r/w when this bit is set to 1, 64 kbytes of eb10 (h'020000 to h'02ffff) will be erased. 1 eb9 0 r/w when this bit is set to 1, 64 kbytes of eb9 (h'010000 to h'01ffff) will be erased. 0 eb8 0 r/w when this bit is set to 1, 32 kbytes of eb8 (h'008000 to h'00ffff) will be erased.
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 729 of 982 rej09b0054-0500 ? 128-kbyte flash memory bit bit name initial value r/w description 7 to 2 ? all 0 r/w reserved initial values should not be changed. 1 eb9 0 r/w when this bit is set to 1, 32 kbytes of eb9 (h'018000 to h'01ffff) will be erased. 0 eb8 0 r/w when this bit is set to 1, 32 kbytes of eb8 (h'010000 to h'017fff) will be erased. 20.5.5 ram emulation register (ramer) ramer specifies the area of flash memory to be overlapped with part of ram when emulating real-time flash memory programming. ramer settings should be made in user mode or user program mode. to ensure correct operation of the emulation function, the rom for which ram emulation is performed should not be accessed immediately after this register has been modified. normal execution of an access immediately after register modification is not guaranteed. bit bit name initial value r/w description 7 to 5 ? all 0 r reserved these bits are always read as 0. 4? 0 r/wreserved only 0 should be written to this bit. 3 rams 0 r/w ram select specifies selection or non-selection of flash memory emulation in ram. when rams = 1, the flash memory is overlapped with part of ram, and all flash memory block are program/erase-protected.
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 730 of 982 rej09b0054-0500 bit bit name initial value r/w description 2 1 0 ram2 ram1 ram0 0 0 0 r/w r/w r/w flash memory area selection when the rams bit is set to 1, one of the following flash memory areas is selected to overlap the ram area. the areas correspond with 4-kbyte erase blocks for the 384- kbyte or 256-kbyte flash memory, 1-kbyte erase block for the 128-kbyte flash memory. 384-kbyte or 256-kbyte flash memory 000: h'000000 to h'000fff (eb0) 001: h'001000 to h'001fff (eb1) 010: h'002000 to h'002fff (eb2) 011: h'003000 to h'003fff (eb3) 100: h'004000 to h'004fff (eb4) 101: h'005000 to h'005fff (eb5) 110: h'006000 to h'006fff (eb6) 111: h'007000 to h'007fff (eb7) 128-kbyte flash memory 000: h'000000 to h'0003ff (eb0) 001: h'000400 to h'0007ff (eb1) 010: h'000800 to h'000bff (eb2) 011: h'000c00 to h'000fff (eb3) 100: setting prohibited 101: setting prohibited 110: setting prohibited 111: setting prohibited
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 731 of 982 rej09b0054-0500 20.5.6 flash memory power control register (flpwcr) flpwcr enables/disables transition to power-down modes for the flash memory when this lsi enters sub-active mode. bit bit name initial value r/w description 7 pdwnd 0 r/w power down disable enables/disables transition to power-down modes for the flash memory when this lsi enters sub-active mode. 0: transition to power-down modes for the flash memory enabled. 1: transition to power-down modes for the flash memory disabled. 6 to 0 ? all 0 r reserved these bits are always read as 0. 20.5.7 serial control register x (scrx) scrx performs register access control. bit bit name initial value r/w description 7? 0 r/wreserved only 0 should be written to this bit. 6 5 iicx1 iicx0 0 0 r/w r/w i 2 c transfer select 1, 0 for details, see section 16.3.5, serial control register x (scrx). 4 iice 0 r/w i 2 c master enable for details, see section 16.3.5, serial control register x (scrx).
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 732 of 982 rej09b0054-0500 bit bit name initial value r/w description 3 flshe 0 r/w flash memory control register enable controls for the cpu accessing to the control registers (flmcr1, flmcr2, ebr1, ebr2) of the flash memory. when this bit is set to 1, the flash memory control registers can be read/written to. when this bit is cleared to 0, the flash memory control registers are not selected. at this time, the contents of the flash memory control registers are retained. 0: area at h'ffffa8 to h'ffffac not selected for the flash memory control registers. 1: area at h'ffffa8 to h'ffffac selected for the flash memory control registers. 2 to 0 ? all 0 r/w reserved only 0 should be written to these bits. 20.6 on-board programming modes when pins are set to on-board programming mode, program/erase/verify operations can be performed on the on-chip flash memory. there are two on-board programming modes: boot mode and user program mode. the pin settings for transition to each of these modes are shown in table 20.3. for a diagram of the transitions to the various flash memory modes, see figure 20.2. table 20.3 setting on-board programming modes mode setting fwe md2 md1 md0 boot mode extended mode 1 0 1 0 single-chip mode 1 0 1 1 user program mode extended mode 1 1 1 0 single-chip mode 1 1 1 1 20.6.1 boot mode table 20.4 shows the boot mode operations between reset end and branching to the programming control program. 1. when boot mode is used, the flash memory programming control program must be prepared in the host beforehand. prepare a programming control program in accordance with the description in section 20.8, flash memory programming/erasing.
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 733 of 982 rej09b0054-0500 in boot mode, if any data has been programmed into the flash memory (if all data is not 1), all flash memory blocks are erased. boot mode is for use when user program mode is unavailable, such as the first time on-board programming is performed, or if the program activated in user program mode is accidentally erased. 2. sci should be set to asynchronous mode, and the transfer format as follows: 8-bit data, 1 stop bit, and no parity. 3. when the boot program is initiated, the chip measures the low-level period of asynchronous sci communication data (h'00) transmitted continuously from the host. the chip then calculates the bit rate of transmission from the host, and adjusts the sci bit rate to match that of the host. the reset should end with the rxd pin high. the rxd and txd pins should be pulled up on the board if necessary. after the reset is complete, it takes approximately 100 states before the chip is ready to measure the low-level period. 4. after matching the bit rates, the chip transmits one h'00 byte to the host to indicate the completion of bit rate adjustment. the host should confirm that this adjustment end indication (h'00) has been received normally, and transmit one h'55 byte to the chip. if reception could not be performed normally, initiate boot mode again by a reset. depending on the host?s transfer bit rate and system clock frequency of this lsi, there will be a discrepancy between the bit rates of the host and the chip. to operate the sci properly, set the host?s transfer bit rate and system clock frequency of this lsi within the ranges listed in table 20.5. 5. in boot mode, a part of the on-chip ram area is used by the boot program. the area h'ffc000 to h'ffdfff is the area to which the programming control program is transferred from the host. the boot program area cannot be used until the execution state in boot mode switches to the programming control program. 6. before branching to the programming control program, the chip terminates transfer operations by sci (by clearing the re and te bits in scr to 0), however the adjusted bit rate value remains set in brr. therefore, the programming control program can still use it for transfer of write data or verify data with the host. the txd pin is high. the contents of the cpu general registers are undefined immediately after branching to the programming control program. these registers must be initialized at the beginning of the programming control program, as the stack pointer (sp), in particular, is used implicitly in subroutine calls, etc. 7. boot mode can be cleared by driving the reset pin low, waiting at least 20 states, then setting the fwe pin and mode pins, and executing reset release*. boot mode is also cleared when a wdt overflow occurs. 8. all interrupts are disabled during programming or erasing of the flash memory. note: * the input signals on the fwe and mode pins must satisfy the mode programming setup time (t mds = 200 ns) at the reset release timing.
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 734 of 982 rej09b0054-0500 table 20.4 boot mode operation item host operation communications contents lsi operation boot mode start branches to boot program at reset-start. processing contents processing contents bit rate adjustment continuously transmits data h'00 at specified bit rate. h'00, h'00 ...... h'00 h'00 h'55 measures low-level period of receive data h'00. calculates bit rate and sets it in brr of sci. transmits data h'00 to host as adjustment end indication. transmits data h'aa to host when data h'55 is received. transmits data h'55 when data h'00 is received error-free. transmits number of bytes (n) of programming control program to be transferred as 2-byte data (low-order byte following high-order byte) receives data h'aa. transmits 1-byte of programming control program (repeated for n times) receives data h'aa. transfer of programming control program flash memory erase execution of programming control program boot program initiation echobacks the 2-byte data received. branches to programming control program transferred to on-chip ram and starts execution. echobacks received data to host and also transfers it to ram (repeated for n times) checks flash memory data, erases all flash memory blocks in case of written data existing, and transmits data h'aa to host. (if erase could not be done, transmits data h'ff to host and aborts operation.) high-order byte and low-order byte h'xx h'aa echoback echoback h'ff h'aa boot program erase error table 20.5 system clock frequencies for which automatic adjustment of lsi bit rate is possible system clock frequency range of this lsi host bit rate h8s/2258 h8s/2238b, h8s/2238r, h8s/2227 h8s/2239 19,200 bps 8 to 13.5 mhz 8 to 20 mhz 9,600 bps 4 to 13.5 mhz 4 to 20 mhz 4,800 bps 10 to 13.5 mhz 2 to 13.5 mhz 2 to 20 mhz
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 735 of 982 rej09b0054-0500 20.6.2 programming/erasing in user program mode on-board programming/erasing of an individual flash memory block can also be performed in user program mode by branching to a user program/erase control program. the user must prepare on- board means for controlling fwe, on-board means of supplying programming data, and branching conditions. the flash memory must contain the user program/erase control program or a program that provides the user program/erase control program from external memory. as the flash memory itself cannot be read during programming/erasing, transfer the user program/erase control program to on-chip ram, as in boot mode. figure 20.8 shows a sample procedure for programming/erasing in user program mode. prepare a user program/erase control program in accordance with the description in section 20.8, flash memory programming/erasing. yes no program/erase? transfer user program/erase control program to ram reset-start branch to user program/erase control program in ram execute user program/erase control program (flash memory rewrite) branch to flash memory application program branch to flash memory application program figure 20.8 programming/erasing flowchart example in user program mode 20.7 flash memory emulation in ram a setting in the ram emulation register (ramer) enables part of ram to be overlapped onto the flash memory area so that data to be written to flash memory can be emulated in ram in real time. emulation can be performed in user mode or user program mode. figure 20.9 shows an example of emulation of real-time flash memory programming.
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 736 of 982 rej09b0054-0500 1. set ramer to overlap part of ram onto the area for which real-time programming is required. 2. emulation is performed using the overlapping ram. 3. after the program data has been confirmed, the rams bit is cleared, thus releasing the ram overlap. 4. the data written in the overlapping ram is written into the flash memory space. start of emulation program set ramer write tuning data to overlap ram execute application program tuning ok? clear ramer write to flash memory emulation block end of emulation program no yes figure 20.9 flowchart for flash memory emulation in ram an example in which flash memory block area eb1 is overlapped is shown in figure 20.10. 1. the ram area to be overlapped is fixed at a 4-kbyte area in the range h'ffd000 to h'ffdfff in the 384-kbyte or 256-kbyte flash memory . the ram area to be overlapped is fixed at a 1- kbyte area in the range h'ffd000 to h'ffd3ff in the 128-kbyte flash memory. 2. the flash memory area to be overlapped is selected by ramer from a 4-kbyte area of the eb0 to eb7 blocks. 3. the overlapped ram area can be accessed from both the flash memory addresses and ram addresses.
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 737 of 982 rej09b0054-0500 4. when the rams bit in ramer is set to 1, program/erase protection is enabled for all flash memory blocks (emulation protection). in this state, setting the p1 or e1 bit in flmcr1 to 1 does not cause a transition to program mode or erase mode. 5. a ram area cannot be erased by execution of software in accordance with the erase algorithm. 6. block area eb0 contains the vector table. when performing ram emulation, the vector table is needed in the overlap ram. h'000000 h'001000 h'002000 h'003000 h'ffd000 h'ffdfff flash memory (eb0) flash memory (eb0) (eb1) (eb2) (eb3) on-chip ram (4 kbytes) on-chip ram (shadow of h'ffe000 to h'ffdfff) flash memory (eb2) on-chip ram (4 kbytes) (eb3) normal memory map ram overlap memory map figure 20.10 example of ram overlap operation 20.8 flash memory programming/erasing a software method using the cpu is employed to program and erase flash memory in the on- board programming modes. depending on the flmcr1 setting, the flash memory operates in one of the following four modes: program mode, program-verify mode, erase mode, and erase-verify
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 738 of 982 rej09b0054-0500 mode. the programming control program in boot mode and the user program/erase control program in user program mode use these operating modes in combination to perform programming/erasing. flash memory programming and erasing should be performed in accordance with the descriptions in section 20.8.1, program/program-verify and section 20.8.2, erase/erase-verify, respectively. 20.8.1 program/program-verify when writing data or programs to the flash memory, the program/program-verify flowchart shown in figure 20.11 should be followed. performing programming operations according to this flowchart will enable data or programs to be written to the flash memory without subjecting the chip to voltage stress or sacrificing program data reliability. 1. programming must be done to an empty address. do not reprogram an address to which programming has already been performed. 2. programming should be carried out 128 bytes at a time. a 128-byte data transfer must be performed even if writing fewer than 128 bytes. in this case, h'ff data must be written to the extra addresses. 3. prepare the following data storage areas in ram: a 128-byte programming data area, a 128- byte reprogramming data area, and a 128-byte additional-programming data area. perform reprogramming data computation and additional programming data computation according to figure 20.11. 4. consecutively transfer 128 bytes of data in byte units from the reprogramming data area or additional-programming data area to the flash memory. the program address and 128-byte data are latched in the flash memory. the lower 8 bits of the start address in the flash memory destination area must be h'00 or h'80. 5. the time during which the p1 bit is set to 1 is the programming time. figure 20.11 shows the allowable programming times. 6. the watchdog timer (wdt) is set to prevent overprogramming due to program runaway, etc. set a value greater than (t spsu + t sp200 + t cp + t cpsu ) s as the wdt overflow period. 7. for a dummy write to a verify address, write 1-byte data h'ff to an address whose lower 1 bit are b'0. verify data can be read in words from the address to which a dummy write was performed. 8. the maximum number of repetitions of the program/program-verify sequence of the same bit is (n).
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 739 of 982 rej09b0054-0500 start end of programming set swe1 bit in flmcr1 start of programming write pulse application subroutine wait (t sswe ) 1 * 2 * 4 start of programming end of programming * 5 * 1 wait (t cpv ) 2 * 4 * 3 * 1 transfer reprogram data to reprogram data area reprogram data computation * 4 transfer additional-programming data to additional-programming data area additional-programming data computation clear pv1 bit in flmcr1 clear swe1 bit in flmcr1 m = 1 reprogram see note 6 for pulse width m = 0 ? increment address programming failure yes clear swe1 bit in flmcr1 wait (t cswe ) 100 use a 10 * 6 for details of the pulse widths. when writing of additional-programming data is executed, a 10 figure 20.11 program/program-verify flowchart
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 740 of 982 rej09b0054-0500 20.8.2 erase/erase-verify when erasing flash memory, the erase/erase-verify flowchart shown in figure 20.12 should be followed. 1. prewriting (setting erase block data to all 0) is not necessary. 2. erasing is performed in block units. make only a single-bit specification in the erase block register 1 and 2 (ebr1 and ebr2). to erase multiple blocks, each block must be erased in turn. 3. the time during which the e1 bit is set to 1 is the flash memory erase time. 4. the watchdog timer (wdt) is set to prevent overprogramming due to program runaway, etc. set a value greater than (t sesu + t se + t ce + t cesu ) ms as the wdt overflow period. 5. for a dummy write to a verify address, write 1-byte data h'ff to an address whose lower 1 bit are b'0. verify data can be read in words from the address to which a dummy write was performed. 5. if the read data is not erased successfully, set erase mode again, and repeat the erase/erase- verify sequence as before. the maximum number of repetitions of the erase/erase-verify sequence is (n).
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 741 of 982 rej09b0054-0500 erase start set ebr1 (2) enable wdt disable wdt read verify data increment address verify data = all 1? last address of block? all erase block erased? set block start address as verify address h'ff dummy write to verify address swe1 bit in flmcr1 = * 5 tcer: wait 4 * 1 * 3 * 2 * 5 * 4 erasing should be done to a block 1. pre-writing (all erase block data are cleared to 0) is not necessary. 2. verify data is read out in 16 bit size (word access). 3. erasing block register (ebr) can be set about 1 bit at a time. do not specify 2 bits or more. 4. erasing is performed block by block. when multiple blocks must be erased, erase each lock one by one. 5. this is a recommended value. to change it, consult tables 27.12, 27.25, 27.37, 27.49, and 27.59 and select a new value such that the erase time (te), wait time after e1 bit setting (tse), and maximum erase count (n) do not exceed the maximum values indicated. notes: figure 20.12 erase/erase-verify flowchart
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 742 of 982 rej09b0054-0500 20.9 program/erase protection there are three kinds of flash memory program/erase protection; hardware protection, software protection, and error protection. 20.9.1 hardware protection hardware protection refers to a state in which programming/erasing of flash memory is forcibly disabled or aborted because of a transition to reset or standby mode. flash memory control register 1 (flmcr1), flash memory control register 2 (flmcr2), erase block register 1 (ebr1), and erase block register 2 (ebr2) are initialized. in a reset via the res pin, the reset state is not entered unless the res pin is held low until oscillation stabilizes after powering on. in the case of a reset during operation, hold the res pin low for the res pulse width specified in the ac characteristics section. 20.9.2 software protection software protection can be implemented against programming/erasing of all flash memory blocks by clearing the swe1 bit in flmcr1. when software protection is in effect, setting the p1 or e1 bit in flmcr1 does not cause a transition to program mode or erase mode. by setting the erase block register 1 and 2 (ebr1 and ebr2), erase protection can be set for individual blocks. when ebr1 and ebr2 are set to h'00, erase protection is set for all blocks. by setting bit rams in ramer, programming/erase protection is set for all blocks. 20.9.3 error protection in error protection, an error is detected when cpu runaway occurs during flash memory programming/erasing, or operation is not performed in accordance with the program/erase algorithm, and the program/erase operation is aborted. aborting the program/erase operation prevents damage to the flash memory due to overprogramming or overerasing. when the following errors are detected during programming/erasing of flash memory, the fler bit in flmcr2 is set to 1, and the error protection state is entered. ? when the flash memory of the relevant address area is read during programming/erasing (including vector read and instruction fetch) ? immediately after exception handling (excluding a reset) during programming/erasing ? when a sleep instruction is executed during programming/erasing ? when the cpu releases the bus to the dmac* or dtc during programming/erasing note: * supported only by the h8s/2239 group.
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 743 of 982 rej09b0054-0500 the flmcr1, flmcr2, ebr1, and ebr2 settings are retained, however program mode or erase mode is aborted at the point at which the error occurred. program mode or erase mode cannot be re-entered by re-setting the p1 or e1 bit. however, pv1 and ev1 bit setting is enabled, and a transition can be made to verify mode. error protection can be cleared only by a reset or in hardware standby. 20.10 interrupt handling when programming/erasing flash memory all interrupts, including nmi input, are disabled when flash memory is being programmed or erased (when the p1 or e1 bit is set in flmcr1), and while the boot program is executing in boot mode * 1 , to give priority to the program or erase operation. there are three reasons for this: 1. interrupt during programming or erasing might cause a violation of the programming or erasing algorithm, with the result that normal operation could not be assured. 2. in the interrupt exception handling sequence during programming or erasing, the vector would not be read correctly * 2 , possibly resulting in cpu runaway. 3. if an interrupt occurred during boot program execution, it would not be possible to execute the normal boot mode sequence. notes: 1. interrupt requests must be disabled inside and outside the cpu until the programming control program has completed programming. 2. the vector may not be read correctly in this case for the following two reasons: ? if flash memory is read while being programmed or erased (while the p1 or e1 bit is set in flmcr1), correct read data will not be obtained (undetermined values will be returned). ? if the interrupt entry in the vector table has not been programmed yet, interrupt exception handling will not be executed correctly. 20.11 programmer mode in programmer mode, a prom programmer can be used to perform programming/erasing via a socket adapter, just as for a discrete flash memory. use a prom programmer which supports the renesas technology 512-kbyte, 256-kbyte, or 128-kbyte flash memory on-chip microcomputer device type. it requires the 12-mhz input clock. the socket adapter pin correspondence diagram is shown in figure 20.13.
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 744 of 982 rej09b0054-0500 this lsi socket adapter (conversion to 40-pin arrangement) fp-100b * 3 ,tfp-100b, tfp-100g * 4 pin no. pin name a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 d0 d1 d2 d3 d4 d5 d6 d7 ce oe we fwe hn27c4096hg (40-pin) pin no. pin name 21 22 23 24 25 26 27 28 29 31 32 33 34 35 36 37 38 39 10 19 18 17 16 15 14 13 12 2 20 3 4 40, 1 30, 11 7, 6, 5 8 9 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 i/o0 i/o1 i/o2 i/o3 i/o4 i/o5 i/o6 i/o7 ce oe we fwe v cc v ss nc a20 a19 res xtal extal nc (open) 13 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 4 5 6 7 8 9 10 11 3 1 2 66 59 63 65 other than the above 99, 75, 72 * 1 , 62, 61, 60, 54, 53, 12 100, 67, 64, 58, 56, 55, 42, 40, 38, 14 v cc v ss oscillator circuit legend: fwe: i/o7 to 0: a18 to 0: oe : ce : we : flash write enable data input/output address input output enable chip enable write enable power-on reset circuit notes: 1. supported only by the h8s/2258 and h8s/2238b. 2. supported only by the h8s/2238r. 3. not supported by the h8s/2227. 4. not supported by the h8s/2258. 5. supported only by the h8s/2238r and h8s/2239. fp-100a * 1 16 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 7 8 9 10 11 12 13 14 6 4 5 69 bp-112 * 2 tbp-112a * 5 f1 g1 g2 g3 h1 g4 h2 j1 h3 j2 k1 j3 k2 l2 h4 k3 l3 j4 k4 c2 c1 d3 d2 d1 e4 e3 e1 d4 b2 b1 e10 62 66 68 other than the above 78, 75, 65, 64, 57, 54, 15, 2 70, 67, 61, 59, 58, 45, 43, 41, 17, 3 e2, f3, h8, j10, g9, g11, f9, g10, c9, b3 f2, f4, j6, k6, k7, l7, j11, h9, h11, f8, f10, e9, a2 g8 f11 e11 other than the above figure 20.13 socket adapter pin correspondence diagram
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 745 of 982 rej09b0054-0500 20.12 power-down states for flash memory in user mode, the flash memory will operate in either of the following states: ? normal operating mode the flash memory can be read and written to at high speed. ? power-down state the flash memory can be read when part of the power circuit is halted and the lsi operates by subclocks. ? standby mode all flash memory circuits are halted. table 20.6 shows the correspondence between the operating modes of this lsi and the flash memory. when the flash memory returns to its normal operating state from standby mode, a period to stabilize the power supply circuits that were stopped is needed. when the flash memory returns to its normal operating state, bits sts2 to sts0 in sbycr must be set to provide a wait time of at least 100 s, even when the external clock is being used. table 20.6 flash memory operating states lsi operating state flash memory operating state active mode normal operating mode sleep mode normal operating mode watch mode standby mode standby mode subactive mode subsleep mode pdwnd = 0: power-down mode (read only) pdwnd = 1: normal operating mode (read only) 20.13 flash memory programming and erasing precautions precautions concerning the use of on-board programming mode, the ram emulation function, and programmer mode are summarized below. use the specified voltages and timing for programming and erasing: applied voltages in excess of the rating can permanently damage the device. use a prom programmer that supports the renesas technology flash memory on-chip microcomputer device type (fztat512v3a, fztat256v3a, or fztat128v3a).
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 746 of 982 rej09b0054-0500 do not select the hn27c4096 setting for the prom programmer, and only use the specified socket adapter. failure to observe these points may result in damage to the device. powering on and off (see figures 20.14 to 20.16): do not apply a high level to the fwe pin until vcc has stabilized. also, drive the fwe pin low before turning off vcc. when applying or disconnecting vcc power, fix the fwe pin low and place the flash memory in the hardware protection state. the power-on and power-off timing requirements should also be satisfied in the event of a power failure and subsequent recovery. fwe application/disconnection (see figures 20.14 to 20.16): fwe application should be carried out when mcu operation is in a stable condition. if mcu operation is not stable, fix the fwe pin low and set the protection state. the following points must be observed concerning fwe application and disconnection to prevent unintentional programming or erasing of flash memory: ? apply fwe when the vcc voltage has stabilized within its rated voltage range. ? in boot mode, apply and disconnect fwe during a reset. ? in user program mode, fwe can be switched between high and low level regardless of the reset state. fwe input can also be switched during execution of a program in flash memory. ? do not apply fwe if program runaway has occurred. ? disconnect fwe only when the swe1, esu1, psu1, ev1, pv1, p1, and e1 bits in flmcr1 are cleared. make sure that the swe1, esu1, psu1, ev1, pv1, p1, and e1 bits are not set by mistake when applying or disconnecting fwe. do not apply a constant high level to the fwe pin: apply a high level to the fwe pin only when programming or erasing flash memory. a system configuration in which a high level is constantly applied to the fwe pin should be avoided. also, while a high level is applied to the fwe pin, the watchdog timer should be activated to prevent overprogramming or overerasing due to program runaway, etc. use the recommended algorithm when programming and erasing flash memory: the recommended algorithm enables programming and erasing to be carried out without subjecting the device to voltage stress or sacrificing program data reliability. when setting the p1 or e1 bit in flmcr1, the watchdog timer should be set beforehand as a precaution against program runaway, etc.
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 747 of 982 rej09b0054-0500 do not set or clear the swe1 bit during execution of a program in flash memory: wait for at least 100 s after clearing the swe1 bit before executing a program or reading data in flash memory. when the swe1 bit is set, data in flash memory can be rewritten. access flash memory only for verify operations (verification during programming/erasing). also, do not clear the swe1 bit during programming, erasing, or verifying. similarly, when using the ram emulation function while a high level is being input to the fwe pin, the swe1 bit must be cleared before executing a program or reading data in flash memory. however, the ram area overlapping flash memory space can be read and written to regardless of whether the swe1 bit is set or cleared. do not use interrupts while flash memory is being programmed or erased: all interrupt requests, including nmi, should be disabled during fwe application to give priority to program/erase operations. do not perform additional programming. erase the memory before reprogramming: in on-board programming, perform only one programming operation on a 128-byte programming unit block. in programmer mode, too, perform only one programming operation on a 128-byte programming unit block. programming should be carried out with the entire programming unit block erased. before programming, check that the chip is correctly mounted in the prom programmer: overcurrent damage to the device can result if the index marks on the prom programmer socket, socket adapter, and chip are not correctly aligned. do not touch the socket adapter or chip during programming: touching either of these can cause contact faults and write errors. reset the flash memory before turning on the power: to reset the flash memory during oscillation stabilization period, the reset signal must be input for at least 100 s. apply the reset signal while swe is low to reset the flash memory during its operation: the reset signal is applied at least 100 s after the swe bit has been cleared.
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 748 of 982 rej09b0054-0500 1. 2. 3. except when switching modes, the level of the mode pins (md2 to md0) must be fixed until power-off by pulling the pins up or down. see sections 27.2.6, 27.3.6, 27.4.6, 27.5.6, and 27.6.6, flash memory characteristics. mode programming setup time t mds (min) = 200 ns. period during which flash memory access is prohibited (t sswe : wait time after setting swe1 bit) * 2 period during which flash memory can be programmed (execution of program in flash memory prohibited, and data reads other than verify operations prohibited) notes: v cc fwe * 3 t mds * 3 md2 to md0 * 1 res swe1bit swe1 set swe1 cleared t sswe 100 figure 20.14 power-on/off timing (boot mode)
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 749 of 982 rej09b0054-0500 swe1 set swe1 cleared v cc fwe * 1 res swe1 bit t sswe t mds * 3 100 * 2 period during which flash memory can be programmed (execution of program in flash memory prohibited, and data reads other than verify operations prohibited) notes: programming/ erasing possible wait time: wait time: figure 20.15 power-on/off timing (user program mode)
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 750 of 982 rej09b0054-0500 v cc fwe t osc1 min 0ms t mds t mds t mds t resw md2 to md0 res swe1 bit mode change * 1 boot mode mode change * 1 user mode user program mode user mode user program mode swe1 set swe1 cleared t sswe * 4 * 4 * 2 * 4 * 4 1. 2. 3. 4. when entering boot mode or making a transition from boot mode to another mode, mode switching must be carried out by means of res input when making a transition from boot mode to another mode, a mode programming setup time t mds (min) of 200 ns is necessary with respect to res clearance timing. see sections 27.2.6, 27.3.6, 27.4.6, 27.5.6 and 27.6.6, flash memory characteristics. wait time: 100 * 2 period during which flash memory can be programmed (execution of program in flash memory prohibited, and data reads other than verify operations prohibited) notes: wait time: programming/ erasing possible t sswe wait time: programming/ erasing possible t sswe wait time: programming/ erasing possible t sswe wait time: programming/ erasing possible figure 20.16 mode transition timing (example: boot mode user mode ? user program mode)
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 751 of 982 rej09b0054-0500 20.14 note on switching from f-ztat version to masked rom version the masked rom version does not have the internal registers for flash memory control that are provided in the f-ztat version. table 20.7 lists the registers that are present in the f-ztat version but not in the masked rom version. if a register listed in table 20.7 is read in the masked rom version, an undefined value will be returned. therefore, if application software developed on the f-ztat version is switched to a masked rom version product, it must be modified to ensure that the registers in table 20.7 have no effect. table 20.7 registers present in f-ztat version but absent in masked rom version register abbreviation address flash memory control register 1 flmcr1 h'ffa8 flash memory control register 2 flmcr2 h'ffa9 erase block register 1 ebr1 h'ffaa erase block register 2 ebr2 h'ffab ram emulation register ramer h'fedb flash memory power control register flpwcr h'ffac serial control register x (only bit 3) scrx h'fdb4
section 20 flash memory (f-ztat version) rev. 5.00 aug 08, 2006 page 752 of 982 rej09b0054-0500
section 21 masked rom rev. 5.00 aug 08, 2006 page 753 of 982 rej09b0054-0500 section 21 masked rom this lsi incorporates a masked rom which has the following features. 21.1 features ? size product class rom size rom address (modes 6 and 7) h8s/2258 group hd6432258 256 kbytes h'000000 to h'03ffff HD6432256 128 kbytes h'000000 to h'01ffff hd6432258w 256 kbytes h'000000 to h'03ffff HD6432256w 128 kbytes h'000000 to h'01ffff h8s/2239 group hd6432239 384 kbytes h'000000 to h'05ffff hd6432239w 384 kbytes h'000000 to h'05ffff h8s/2238 group hd6432238b 256 kbytes h'000000 to h'03ffff hd6432236b 128 kbytes h'000000 to h'01ffff hd6432238r 256 kbytes h'000000 to h'03ffff hd6432236r 128 kbytes h'000000 to h'01ffff hd6432238bw 256 kbytes h'000000 to h'03ffff hd6432236bw 128 kbytes h'000000 to h'01ffff hd6432238rw 256 kbytes h'000000 to h'03ffff hd6432236rw 128 kbytes h'000000 to h'03ffff h8s/2237 group hd6432237 128 kbytes h'000000 to h'01ffff hd6432235 128 kbytes h'000000 to h'01ffff hd6432233 64 kbytes h'000000 to h'00ffff h8s/2227 group hd6432227 128 kbytes h'000000 to h'01ffff hd6432225 128 kbytes h'000000 to h'01ffff hd6432224 96 kbytes h'000000 to h'017fff hd6432223 64 kbytes h'000000 to h'00ffff ? connected to the bus master through 16-bit data bus, enabling one-state access to both byte data and word data. figure 21.1 shows a block diagram of the on-chip masked rom.
section 21 masked rom rev. 5.00 aug 08, 2006 page 754 of 982 rej09b0054-0500 internal data bus (upper 8 bits) internal data bus (lower 8 bits) h'000000 h'000002 h'000001 h'000003 h'05fffe h'05ffff figure 21.1 block diagram of on-chip masked rom (384 kbytes)
section 22 prom rev. 5.00 aug 08, 2006 page 755 of 982 rej09b0054-0500 section 22 prom the prom version can be set to prom mode and programmed with a prom programmer. 22.1 prom mode setting the prom version (hd6472237) suspends its microcomputer functions when placed in prom mode, enabling the on-chip prom to be programmed. this programming can be done with a prom programmer set up in the same way as for the hn27c101 (v pp = 12.5 v) eprom. use of a socket adapter to convert from 100 pins to 32 pins enables programming with a commercial prom programmer. caution is required when selecting the prom programmer, as this lsi does not support page mode. table 22.1 shows how prom mode is selected. table 22.1 selecting prom mode pin names setting md2, md1, md0 low stby pa2, pa1 high 22.2 socket adapter and memory map programs can be written and verified by attaching a socket adapter to convert from 100 pins to 32 pins to the prom programmer. figure 22.1 shows the wiring of the socket adapter, and table 22.2 gives ordering information for the socket adapter. figure 22.2 shows the memory map in prom mode.
section 22 prom rev. 5.00 aug 08, 2006 page 756 of 982 rej09b0054-0500 pin no. 59 4 5 6 7 8 9 10 11 13 15 16 17 18 19 20 21 22 60 24 25 26 27 28 29 30 73 23 74 62, 12 54 53 31 32 64, 14 42 61 55 56 67 pin function res pd0 pd1 pd2 pd3 pd4 pd5 pd6 pd7 pc0 pc1 pc2 pc3 pc4 pc5 pc6 pc7 pb0 nmi pb2 pb3 pb4 pb5 pb6 pb7 pa0 pf2 pb1 pf1 vcc avcc vref pa1 pa2 vss avss stby md0 md1 md2 hn27c101 (dip-32) pin no. 1 13 14 15 17 18 19 20 21 12 11 10 9 8 7 6 5 27 26 23 25 4 28 29 3 2 22 24 31 32 16 pin function vpp eo0 eo1 eo2 eo3 eo4 eo5 eo6 eo7 ea0 ea1 ea2 ea3 ea4 ea5 ea6 ea7 ea8 ea9 ea10 ea11 ea12 ea13 ea14 ea15 ea16 ce oe pgm v cc v ss hd6472237 (fp-100b, tfp-100b, tfp-100g) eprom socket note: pins not shown in this figure should be open. vpp: eo7 to eo0: ea16 to ea0: oe : ce : pgm : programing power supply (12.5 v) data input/outout address input output enable chip enable program legend: figure 22.1 hd6472237 socket adapter pin correspondence diagram (fp-100b, tfp-100b, tfp-100g)
section 22 prom rev. 5.00 aug 08, 2006 page 757 of 982 rej09b0054-0500 pin no. 62 7 8 9 10 11 12 13 14 16 18 19 20 21 22 23 24 25 63 27 28 29 30 31 32 33 76 26 77 65, 15 57 56 34 35 67, 17 45 64 58 59 70 pin function res pd0 pd1 pd2 pd3 pd4 pd5 pd6 pd7 pc0 pc1 pc2 pc3 pc4 pc5 pc6 pc7 pb0 nmi pb2 pb3 pb4 pb5 pb6 pb7 pa0 pf2 pb1 pf1 vcc avcc vref pa1 pa2 vss avss stby md0 md1 md2 hn27c101 (dip-32) pin no. 1 13 14 15 17 18 19 20 21 12 11 10 9 8 7 6 5 27 26 23 25 4 28 29 3 2 22 24 31 32 16 pin function vpp eo0 eo1 eo2 eo3 eo4 eo5 eo6 eo7 ea0 ea1 ea2 ea3 ea4 ea5 ea6 ea7 ea8 ea9 ea10 ea11 ea12 ea13 ea14 ea15 ea16 ce oe pgm v cc v ss hd6472237 (fp-100a) eprom socket note: pins not shown in this figure should be open. vpp: eo7 to eo0: ea16 to ea0: oe : ce : pgm : programing power supply (12.5 v) data input/outout address input output enable chip enable program legend: figure 22.2 hd6472237 socket adapter pin correspondence diagram (fp-100a)
section 22 prom rev. 5.00 aug 08, 2006 page 758 of 982 rej09b0054-0500 table 22.2 socket adapters socket adapter product name package minato electronics data io japan h8s/2237 100-pin tqfp (tfp-100b) me2237esns1h h7223bt100d3201 100-pin tqfp (tfp-100g) me2237esms1h h7223gt100d3201 100-pin qfp (fp-100a) me2237esfs1h h7223aq100d3201 100-pin qfp (fp-100b) me2237eshs1h h7223bq100d3201 on-chip prom address in mcu mode address in prom mode h'000000 h'01ffff h'00000 h'1ffff figure 22.3 memory map in prom mode
section 22 prom rev. 5.00 aug 08, 2006 page 759 of 982 rej09b0054-0500 22.3 programming table 22.3 shows how to select the program, verify, and other modes in prom mode. table 22.3 mode selection in prom mode pins mode ce ce ce ce oe oe oe oe pgm pgm pgm pgm vpp vcc eo7 to eo0 ea16 to ea0 program l h l v pp v cc data input address input verify llhv pp v cc data output address input programming prohibitedlllv pp v cc high impedance address input lhh hl l hhh legend: l: low voltage level h: high voltage level v pp :v pp voltage level v cc :v cc voltage level programming and verification should be carried out using the same specifications as for the standard hn27c101 eprom. however, do not set the prom programmer to page mode does not support page programming. a prom programmer that only supports page programming cannot be used. when choosing a prom programmer, check that it supports high-speed programming in byte units. always set addresses within the range h'00000 to h'1ffff. 22.3.1 programming and verification an efficient, high-speed programming procedure can be used to program and verify prom data. this procedure writes data quickly without subjecting the chip to voltage stress or sacrificing data reliability. it leaves the data h'ff in unused addresses. figure 22.4 shows the basic high-speed programming flowchart. tables 22.4 and 22.5 list the electrical characteristics of the chip during programming. figure 22.5 shows a timing chart.
section 22 prom rev. 5.00 aug 08, 2006 page 760 of 982 rej09b0054-0500 start set program/verification mode address = 0 verification? yes no n = 0 n + 1 n program width t pw = 0.2 ms 5% last address? all address read? v cc = 6.0 v 0.25 v, v pp = 12.5 v 0.3 v yes no no yes go address + 1 address n < 25 end fail no go set read mode v cc = 5.0 v 0.25 v, v pp = v cc program width t opw = 0.2n ms figure 22.4 high-speed programming flowchart
section 22 prom rev. 5.00 aug 08, 2006 page 761 of 982 rej09b0054-0500 table 22.4 dc characteristics in prom mode (conditions: v cc = 6.0 v 0.25 v, v pp = 12.5 v 0.3 v, v ss = 0 v, t a = 25c 5c) item symbol min typ max unit test conditions input high voltage eo7 to eo0, ea16 to ea0, oe , ce , pgm v ih 2.4 ? v cc + 0.3 v input low voltage eo7 to eo0, ea16 to ea0, oe , ce , pgm v il ?0.3 ? 0.8 v output high voltage eo7 to eo0 v oh 2.4 ? ? v i oh = ?200 a output low voltage eo7 to eo0 v ol ? ? 0.45 v i ol = 1.6 ma input leakage current eo7 to eo0, ea16 to ea0, oe , ce , pgm | i li |??2 av in = 5.25 v/0.5 v v cc current i cc ??40 ma v pp current i pp ??40 ma
section 22 prom rev. 5.00 aug 08, 2006 page 762 of 982 rej09b0054-0500 table 22.5 ac characteristics in prom mode (conditions: v cc = 6.0 v 0.25 v, v pp = 12.5 v 0.3 v, t a = 25c 5c) item symbol min typ max unit test conditions address setup time t as 2 ??sfigure 22.5 * 1 oe setup time t oes 2 ??s data setup time t ds 2 ??s address hold time t ah 0 ??s data hold time t dh 2 ??s data output disable time t df * 2 ? ? 130 ns v pp setup time t vps 2 ??s programming pulse width t pw 0.19 0.20 0.21 ms pgm pulse width for overwrite programming t opw * 3 0.19 ? 5.25 ms v cc setup time t vcs 2 ??s ce setup time t ces 2 ??s data output delay time t oe 0 ? 150 ns notes: 1. input pulse level: 0.8 v to 2.2 v input rise time/fall time 20 ns timing reference levels: input: 1.0 v, 2.0 v output: 0.8 v, 2.0 v 2. t df is defined to be when output has reached the open state, and the output level can no longer be referenced. 3. t opw is defined by the value shown in the flowchart.
section 22 prom rev. 5.00 aug 08, 2006 page 763 of 982 rej09b0054-0500 program verification input data output data t as t ah t df t dh t ds t vps t vcs t ces t pw t opw * t oes t oe address data vpp vcc ce pgm oe v pp v cc v cc +1 v cc note: * t opw is defined by the value shown in the flowchart. figure 22.5 prom programming/verification timing 22.3.2 programming precautions ? program using the specified voltages and timing. the programming voltage (v pp ) in prom mode is 12.5 v. applied voltages in excess of the specified values can permanently destroy the mcu. be particularly careful about the prom programmer?s overshoot characteristics. if the prom programmer is set to renesas technology hn27c101 specifications, v pp will be 12.5 v. ? before programming, check that the mcu is correctly mounted in the prom programmer. overcurrent damage to the mcu can result if the index marks on the prom programmer, socket adapter, and mcu are not correctly aligned. ? do not touch the socket adapter or mcu while programming. touching either of these can cause contact faults and programming errors. ? the mcu cannot be programmed in page programming mode. select the programming mode carefully.
section 22 prom rev. 5.00 aug 08, 2006 page 764 of 982 rej09b0054-0500 ? the size of the prom is 128 kbytes. always set addresses within the range h'00000 to h'1ffff. during programming, write h'ff to unused addresses to avoid verification errors. 22.3.3 reliability of programmed data an effective way to assure the data retention characteristics of the programmed chips is to bake them at 150c, then screen them for data errors. this procedure quickly eliminates chips with prom memory cells prone to early failure. figure 22.6 shows the recommended screening procedure. mount programing the chip and verify programed data bake chip for 24 to 48 hours at 125 c to 150 c with power off read and check program figure 22.6 recommended screening procedure if a series of programming errors occurs while the same prom programmer is being used, stop programming and check the prom programmer and socket adapter for defects. please inform renesas technology of any abnormal conditions noted during or after programming or in screening of program data after high-temperature baking.
section 23 clock pulse generator rev. 5.00 aug 08, 2006 page 765 of 982 rej09b0054-0500 section 23 clock pulse generator this lsi has an on-chip clock pulse generator that generates the system clock ( ), the bus master clock, and internal clocks. the clock pulse generator consists of an oscillator, duty adjustment circuit, clock selection circuit, medium-speed clock divider, bus master clock selection circuit, subclock oscillator, and wave formation circuit. a block diagram of the clock pulse generator is shown in figure 23.1. legend: lpwrcr: sckcr: low-power control register system clock control register extal xtal duty adjustment circuit medium- speed clock divider system clock oscillator clock selection circuit sub wdt_1 count clock internal clock to peripheral modules system clock pin bus master cloc k to cpu and dtc and dmac * /2 to /32 sck2 to sck0 sckcr rfcut osc1 osc2 waveform generation circuit subclock oscillator lpwrcr bus master clock selection circuit note: * supported only by the h8s/2239 group. figure 23.1 block diagram of clock pulse generator frequency changes are performed by software by settings in the low-power control register (lpwrcr) and system clock control register (sckcr).
section 23 clock pulse generator rev. 5.00 aug 08, 2006 page 766 of 982 rej09b0054-0500 23.1 register descriptions the on-chip clock pulse generator has the following registers. ? system clock control register (sckcr) ? low-power control register (lpwrcr) 23.1.1 system clock control register (sckcr) sckcr performs medium-speed mode control. bit bit name initial value r/w description 7 pstop 0 r/w clock output prohibited controls output. ? high-speed mode, medium-speed mode, subactive mode, sleep mode, and subsleep mode 0: output 1: fixed to high ? software standby mode, watch mode, and direct transition 0: fixed to high 1: fixed to high ? hardware standby mode 0: high impedance 1: high impedance 6? 0 r/wreserved this bit is readable/writable, but the write value should always be 0. 5, 4 ? all 0 ? reserved these bits are always read as 0, and cannot be modified. 3? 0 r/wreserved this bit is readable/writable, but the write value should always be 0.
section 23 clock pulse generator rev. 5.00 aug 08, 2006 page 767 of 982 rej09b0054-0500 bit bit name initial value r/w description 2 1 0 sck2 sck1 sck0 0 0 0 r/w r/w r/w system clock select 2 to 0 these bits select the bus master clock. 000: high-speed mode 001: medium-speed clock /2 010: medium-speed clock /4 011: medium-speed clock /8 100: medium-speed clock /16 101: medium-speed clock /32 11 : setting prohibited legend: : don?t care
section 23 clock pulse generator rev. 5.00 aug 08, 2006 page 768 of 982 rej09b0054-0500 23.1.2 low-power control register (lpwrcr) lpwrcr performs down-mode control, selects sampling frequency for eliminating noise, performs subclock generation control, and specifies multiplication factor. bit bit name initial value r/w description 7 dton 0 r/w direct transfer on flag 0: when the sleep instruction is executed in high- speed mode or medium-speed mode, operation shifts to sleep mode, software standby mode, or watch mode * . when the sleep instruction is executed in sub- active mode, operation shifts to sub-sleep mode or watch mode. 1: when the sleep instruction is executed in high- speed mode or medium-speed mode, operation shifts directly to sub-active mode * , or shifts to sleep mode or software standby mode. when the sleep instruction is executed in sub- active mode, operation shifts directly to high- speed mode, or shifts to sub-sleep mode. 6 lson 0 r/w low speed on fag 0: when the sleep instruction is executed in high- speed mode or medium-speed mode, operation shifts to sleep mode, software standby mode, or watch mode * . when the sleep instruction is executed in sub- active mode, operation shifts to watch mode * or shifts directly to high-speed mode. operation shifts to high-speed mode when watch mode is cancelled. 1: when the sleep instruction is executed in high- speed mode, operation shifts to watch mode or sub-active mode. when the sleep instruction is executed in sub- active mode, operation shifts to sub-sleep mode or watch mode. operation shifts to sub-active mode when watch mode is cancelled.
section 23 clock pulse generator rev. 5.00 aug 08, 2006 page 769 of 982 rej09b0054-0500 bit bit name initial value r/w description 5 nesel 0 r/w noise elimination sampling frequency select this bit selects the sampling frequency of the subclock ( sub ) generated by the subclock oscillator is sampled by the clock ( ) generated by the system clock oscillator set 0 when is 5 mhz or higher. set 1 when is 2.1 mhz or lower. any value can be set when is 2.1 to 5 mhz. 0: sampling using 1/32 1: sampling using 1/4 4 substp 0 r/w subclock enable this bit enables/disables subclock generation. this bit should be set to 1 when subclock is not used. 0: enables subclock generation. 1: disables subclock generation. 3 rfcut 0 r/w oscillation circuit feedback resistance control bit selects whether or not built-in feedback resistance and duty adjustment circuit of the system clock generator are used when an external clock is input. do not access when the crystal resonator is used. after setting this bit in the external clock input state, enter software standby mode, watch mode, or subactive mode. when software standby mode, watch mode, or subactive mode is entered, switch whether or not built-in feedback resistance and duty adjustment circuit are used. 0: built-in feedback resistance and duty adjustment circuit of the system clock generator used. 1: built-in feedback resistance and duty adjustment circuit of the system clock generator not used. 2? 0 r/wreserved this bit is readable/writable, but the write value should always be 0.
section 23 clock pulse generator rev. 5.00 aug 08, 2006 page 770 of 982 rej09b0054-0500 bit bit name initial value r/w description 1 0 stc1 stc0 0 0 r/w r/w multiplication factor setting specifies multiplication factor of the pll circuit built in the evaluation chip. the specified multiplication factor becomes valid software standby mode, watch mode, or subactive mode is entered. these bits should be set to 11 in this lsi. since the value becomes stc1 = stc0 = 0 after a reset, set stc1 = stc0 = 1. 00: 1 01: 2 (setting prohibited) 10: 4 (setting prohibited) 11: pll is bypass note: * when watch mode or subactive mode is entered, set high-speed mode. 23.2 system clock oscillator system clock pulses can be supplied by connecting a crystal resonator, or by input of an external clock. 23.2.1 connecting a crystal resonator a crystal resonator can be connected as shown in the example in figure 23.2. select the damping resistance r d according to table 23.1. an at-cut parallel-resonance crystal should be used. extal xtal r d c l2 c l1 c l1 = c l2 = 10 to 22 pf note: c l1 and c l2 are reference values including the floating capacitance of the board. figure 23.2 connection of crystal resonator (example)
section 23 clock pulse generator rev. 5.00 aug 08, 2006 page 771 of 982 rej09b0054-0500 table 23.1 damping resistance value frequency (mhz) 2 * 1 4 * 1 6 * 1 8 * 1 10 12 16 * 2 20 * 2 r d ( ? ) 1 k 500 300 200 100 0 0 0 notes: 1. the h8s/2258 group is out of operation. 2. supported only by the h8s/2239 group. figure 23.3 shows the equivalent circuit of the crystal resonator. use a crystal resonator that has the characteristics shown in table 23.2. xtal c l at-cut parallel-resonance type extal c 0 lr s figure 23.3 crystal resonator equivalent circuit table 23.2 crystal resonator characteristics frequency (mhz) 2 * 1 4 * 1 6 * 1 8 * 1 10 12 16 * 2 20 * 2 r s max ( ? ) 500 120 100 80 60 60 50 40 c 0 max (pf) 77777777 notes: 1. the h8s/2258 group is out of operation. 2. supported only by the h8s/2239 group. 23.2.2 external clock input an external clock signal can be input as shown in the examples in figure 23.4. if the xtal pin is left open, ensure that stray capacitance does not exceed 10 pf. when complementary clock is input to the xtal pin, the external clock input should be fixed high in standby mode, subactive mode, subsleep mode, or watch mode.
section 23 clock pulse generator rev. 5.00 aug 08, 2006 page 772 of 982 rej09b0054-0500 extal xtal extal xtal external clock input open external clock input (a) xtal pin left open (b) complementary clock input at xtal pin figure 23.4 external clock input (examples) table 23.3 shows the input conditions for the external clock. table 23.4 shows the input conditions for the external clock when duty adjustment circuit is not used. table 23.3 external clock input conditions (1) (h8s/2258 group) v cc = 4.0 v to 5.5 v item symbol min max unit test conditions external clock input low pulse width t exl 30 ? ns external clock input high pulse width t exh 30 ? ns external clock rise time t exr ?7 ns external clock fall time t exf ?7 ns figure 23.5 clock low pulse width t cl 0.4 0.6 t cyc clock high pulse width t ch 0.4 0.6 t cyc figure 27.10
section 23 clock pulse generator rev. 5.00 aug 08, 2006 page 773 of 982 rej09b0054-0500 table 23.3 external clock input conditions (2) (h8s/2238b, h8s/2236b) f-ztat masked rom v cc = 3.0 v to 5.5 v v cc = 2.7 v to 5.5 v item symbol min max min max unit test conditions external clock input low pulse width t exl 30 ? 30 ? ns external clock input high pulse width t exh 30 ? 30 ? ns external clock rise time t exr ?7?7ns external clock fall time t exf ?7?7ns figure 23.5 0.4 0.6 0.4 0.6 t cyc 5 mhz clock low pulse width t cl 80 ? 80 ? ns < 5 mhz figure 27.10 t ch 0.4 0.6 0.4 0.6 t cyc 5 mhz clock high pulse width 80 ? 80 ? ns < 5 mhz table 23.3 external clock input conditions (3) (h8s/2238r, h8s/2236r) f-ztat masked rom v cc = 2.7 v to 3.6 v v cc = 2.2 v to 3.6 v item symbol min max min max unit test conditions external clock input low pulse width t exl 30 ? 65 ? ns external clock input high pulse width t exh 30 ? 65 ? ns external clock rise time t exr ?7?15ns external clock fall time t exf ?7?15ns figure 23.5 0.4 0.6 0.35 0.65 t cyc 5 mhz clock low pulse width t cl 80 ? 70 ? ns < 5 mhz figure 27.10 t ch 0.4 0.6 0.35 0.65 t cyc 5 mhz clock high pulse width 80 ? 70 ? ns < 5 mhz
section 23 clock pulse generator rev. 5.00 aug 08, 2006 page 774 of 982 rej09b0054-0500 table 23.3 external clock input conditions (4) (h8s/2237 group, h8s/2227 group) f-ztat and masked rom masked rom ztat v cc = 2.7 v to 3.6 v v cc = 2.2 v to 3.6 v v cc = 2.7 v to 3.6 v item symbol min max min max min max unit test conditions external clock input low pulse width t exl 30 ? 65 ? 40 ? ns external clock input high pulse width t exh 30 ? 65 ? 40 ? ns external clock rise time t exr ? 7 ? 15 ? 10 ns external clock fall time t exf ? 7 ? 15 ? 10 ns figure 23.5 t cl 0.4 0.6 0.35 0.65 0.4 0.6 t cyc 5 mhz clock low pulse width 80 ? 70 ? 80 ? ns < 5 mhz figure 27.10 t ch 0.4 0.6 0.35 0.65 0.4 0.6 t cyc 5 mhz clock high pulse width 80 ? 70 ? 80 ? ns < 5 mhz table 23.3 external clock input conditions (5) (h8s/2239 group) f-ztat and masked rom masked rom v cc = 3.0 v to 3.6 v v cc = 2.7 v to 3.6 v v cc = 2.2 v to 3.6 v item symbol min max min max min max unit test conditions external clock input low pulse width t exl 20 ? 25 ? 65 ? ns external clock input high pulse width t exh 20 ? 25 ? 65 ? ns external clock rise time t exr ?5 ?6.25?15ns external clock fall time t exf ?5 ?6.25?15ns figure 23.5 0.4 0.6 0.4 0.6 0.35 0.65 t cyc 5 mhz clock low pulse width t cl ??80?70?ns < 5 mhz figure 27.10 t ch 0.4 0.6 0.4 0.6 0.35 0.65 t cyc 5 mhz clock high pulse width ??80?70?ns < 5 mhz
section 23 clock pulse generator rev. 5.00 aug 08, 2006 page 775 of 982 rej09b0054-0500 table 23.4 external clock input conditions (duty adjustment circuit unused) (1) (h8s/2258 group) v cc = 4.0 v to 5.5 v item symbol min max unit test conditions external clock input low pulse width t exl 37 ? ns external clock input high pulse width t exh 37 ? ns external clock rise time t exr ?7 ns external clock fall time t exf ?7 ns figure 23.5 note: if the duty adjustment circuit is not used, the maximum operating frequency will be lower to match the input waveform. (example: if t exl = t exh = 37 ns and t exr = t exf = 7 ns, the clock cycle = 88 ns and the maximum operating frequency = 11.3 mhz) table 23.4 external clock input conditions (duty adjustment circuit unused) (2) (h8s/2238b, h8s/2236b) f-ztat masked rom v cc = 3.0 v to 5.5 v v cc = 2.7 v to 5.5 v item symbol min max min max unit test conditions external clock input low pulse width t exl 37 ? 37 ? ns external clock input high pulse width t exh 37 ? 37 ? ns external clock rise time t exr ?7 ?7 ns external clock fall time t exf ?7 ?7 ns figure 23.5 note: if the duty adjustment circuit is not used, the maximum operating frequency will be lower to match the input waveform. (example: if t exl = t exh = 37 ns and t exr = t exf = 7 ns, the clock cycle = 88 ns and the maximum operating frequency = 11.3 mhz)
section 23 clock pulse generator rev. 5.00 aug 08, 2006 page 776 of 982 rej09b0054-0500 table 23.4 external clock input conditions (duty adjustment circuit unused) (3) (h8s/2238r, h8s/2236r) f-ztat f-ztat and masked rom v cc = 2.7 v to 3.6 v v cc = 2.2 v to 3.6 v item symbol min max min max unit test conditions external clock input low pulse width t exl 37 ? 80 ? ns external clock input high pulse width t exh 37 ? 80 ? ns external clock rise time t exr 7 ? 15 ns external clock fall time t exf ?7?15ns figure 23.5 note: if the duty adjustment circuit is not used, the maximum operating frequency will be lower to match the input waveform. (example: if t exl = t exh = 37 ns and t exr = t exf = 7 ns, the clock cycle = 88 ns and the maximum operating frequency = 11.3 mhz) table 23.4 external clock input conditions (duty adjustment circuit unused) (4) (h8s/2237 group, h8s/2227 group) f-ztat and masked rom masked rom ztat v cc = 2.7 v to 3.6 v v cc = 2.2 v to 3.6 v v cc = 2.7 v to 3.6 v item symbol min max min max min max unit test conditions external clock input low pulse width t exl 37 ? 80 ? 50 ? ns external clock input high pulse width t exh 37 ? 80 ? 50 ? ns external clock rise time t exr ? 7 ? 15 ? 10 ns external clock fall time t exf ? 7 ? 15 ? 10 ns figure 23.5 note: if the duty adjustment circuit is not used, the maximum operating frequency will be lower to match the input waveform. (example: if t exl = t exh = 37 ns and t exr = t exf = 7 ns, the clock cycle = 88 ns and the maximum operating frequency = 11.3 mhz)
section 23 clock pulse generator rev. 5.00 aug 08, 2006 page 777 of 982 rej09b0054-0500 table 23.4 external clock input conditions (duty adjustment circuit unused) (5) (h8s/2239 group) f-ztat and masked rom masked rom v cc = 3.0 v to 3.6 v v cc = 2.7 v to 3.6 v v cc = 2.2 v to 3.6 v item symbol min max min max min max unit test conditions external clock input low pulse width t exl 25 ? 31.25 ? 80 ?ns external clock input high pulse width t exh 25 ? 31.25 ? 80 ?ns external clock rise time t exr ? 5 ?6.25? 15 ns external clock fall time t exf ? 5 ?6.25? 15 ns figure 23.5 note: when a duty adjustment circuit is not used, maximum operating frequency is lowered according to the input waveform. (example: when t exl = t exh = 25 ns, t exr = t exf = 5 ns, clock cycle time = 60 ns, and maximum operating frequency = 16.6 mhz) t exh t exl t exr t exf v cc 0.5 extal figure 23.5 external clock input timing 23.2.3 notes on switching external clock when two or more external clocks (e.g.:10 mhz and 2 mhz) are used as the system clock, input clock should be switched in software standby mode. an example of external clock switching circuit is shown in figure 23.6. an example of external clock switching timing is shown in figure 23.7.
section 23 clock pulse generator rev. 5.00 aug 08, 2006 page 778 of 982 rej09b0054-0500 this lsi port output external interrupt extal external clock 1 external clock 2 selector control circuit external clock switch request external interrupt signal external clock switch signal figure 23.6 external clock switching circuit (example) 200 ns or more (2) (1) port output (clock switching) (2) transition to software standby mode (3) external clock switching (4) external interrupt generation (an interrupt should be input 200 ns or more after transition to software standby mode.) (5) interrupt exception handling (5) sleep instruction execution interrupt exception handling operation external clock 1 external clock 2 (1) port output (3) external clock switching circuit extal internal clock (4) standby time external interrupt active (external clock 1) active (external clock 2) software standby mode clock switching request figure 23.7 external clock switching timing (example)
section 23 clock pulse generator rev. 5.00 aug 08, 2006 page 779 of 982 rej09b0054-0500 23.3 duty adjustment circuit the duty adjustment circuit is valid when oscillation frequency is more than 5 mhz. the duty adjustment circuit adjusts clock output fr/m the system clock oscillator to generate the system clock ( ). 23.4 medium-speed clock divider the medium-speed clock divider divides the system clock to generate /2, /4, /8, /16, and /32. 23.5 bus master clock selection circuit the bus master clock selection circuit selects the clock supplied to the bus master by setting the bits sck2 to sck0 in sckcr. the bus master clock can be selected from system clock ( ), or medium-speed clocks ( /2, /4, /8, /16, /32). 23.6 system clock when using iebus when using the iebus, the system clock must be set to either 12 mhz or 12.58 mhz. when the iebus is not used, the system clock can be set to an arbitrary frequency between 10 mhz to 13.5 mhz. note: iebus is supported only by the h8s/2258 group.
section 23 clock pulse generator rev. 5.00 aug 08, 2006 page 780 of 982 rej09b0054-0500 23.7 subclock oscillator 23.7.1 connecting 32.768-khz crystal resonator to supply a clock to the subclock divider, connect a 32.768-khz crystal resonator, as shown in figure 23.8. figure 23.9 shows the equivalence circuit for a 32.768-khz oscillator. osc1 osc2 c 1 c 2 c 1 = c 2 = 15 pf (typ) note: cl1 and cl2 are reference values including the floating capacitance of the board. figure 23.8 connection example of 32.768-khz quartz oscillator osc1 osc2 c s l s r s c o co = 1.5 pf (typ) rs = 14 k ? (typ) fw = 32.768 khz type name = c001r (seiko epson) figure 23.9 equivalence circuit for 32.768-khz oscillator
section 23 clock pulse generator rev. 5.00 aug 08, 2006 page 781 of 982 rej09b0054-0500 23.7.2 handling pins when subclock not required if no subclock is required, connect the osc1 pin to vss and leave osc2 open, as shown in figure 23.10. the substp bit in lpwrcr must be set to 1. if the substp bit is not set to 1, transitions to the power-down modes may not complete normally. on the h8s/2237 and h8s/2227 group, the osc1 pin should be connected to vcc. osc1 osc2 open figure 23.10 pin handling when subclock not required 23.8 subclock waveform generation circuit to eliminate noise from the subclock input to osci, the subclock is sampled using the dividing clock . the sampling frequency is set using the nesel bit of lpwrcr. for details, see section 23.1.2, low power control register (lpwrcr). no sampling is performed in sub-active mode, sub-sleep mode, or watch mode. 23.9 usage notes 23.9.1 note on crystal resonator as various characteristics related to the crystal resonator are closely linked to the user?s board design, thorough evaluation is necessary on the user?s part, using the resonator connection examples shown in this section as a guide. as the resonator circuit ratings will depend on the floating capacitance of the resonator and the mounting circuit, the ratings should be determined in consultation with the resonator manufacturer. the design must ensure that a voltage exceeding the maximum rating is not applied to the oscillator pin.
section 23 clock pulse generator rev. 5.00 aug 08, 2006 page 782 of 982 rej09b0054-0500 23.9.2 note on board design when designing the board, place the crystal resonator and its load capacitors as close as possible to the extal, xtal, osc1, and osc2 pins. make wires as short as possible. other signal lines should be routed away from the oscillator circuit, as shown in figure 23.11. this is to prevent induction from interfering with correct oscillation. c2 avoid signal a signal b c1 this lsi extal, osc1 xtal, osc2 figure 23.11 note on board design of oscillator circuit
section 24 power-down modes rev. 5.00 aug 08, 2006 page 783 of 982 rej09b0054-0500 section 24 power-down modes in addition to the normal program execution state, this lsi has nine power-down modes in which operation of the cpu and oscillator is halted and power dissipation is reduced. low-power operation can be achieved by individually controlling the cpu, on-chip peripheral modules, and so on. this lsi operating modes are as follows: 1. high-speed mode 2. medium-speed mode 3. subactive mode 4. sleep mode 5. subsleep mode 6. watch mode 7. module stop mode 8. software standby mode 9. hardware standby mode 2. to 9. are low power dissipation states. sleep mode and subsleep mode are cpu states, medium- speed mode is a cpu and bus master state, subactive mode is a cpu and bus master and internal peripheral function state, and module stop mode is an internal peripheral function (including bus masters other than the cpu) state. some of these states can be combined. after a reset, the lsi is in high-speed mode with modules other than the dtc in module stop mode. table 24.1 shows the internal state of the lsi in the respective modes. table 24.2 shows the conditions for shifting between the low power dissipation modes. figure 24.1 is a mode transition diagram.
section 24 power-down modes rev. 5.00 aug 08, 2006 page 784 of 982 rej09b0054-0500 table 24.1 lsi internal states in each mode function high- speed medium- speed sleep module stop watch sub active subsleep software standby hardware standby system clock pulse generator function- ing function- ing function- ing function- ing halted halted halted halted halted subclock pulse generator function- ing/halted function- ing/halted function- ing/halted function- ing/halted function- ing function- ing function- ing function- ing/halted halted cpu instruc- tions halted halted halted halted halted registers function- ing medium- speed operation retained function- ing retained subclock operation retained retained undefined ram function- ing function- ing function- ing (dtc) function- ing retained function- ing retained retained retained i/o function- ing function- ing function- ing function- ing retained function- ing function- ing retained high impedance nmi external interrupts irqn function- ing function- ing function- ing function- ing function- ing function- ing function- ing function- ing halted peripheral functions pbc function- ing medium- speed operation function- ing function- ing/halted (retained) halted (retained) subclock operation halted (retained) halted (retained) halted (reset) dtc dmac * 1 function- ing medium- speed operation function- ing function- ing/halted (retained) halted (retained) halted (retained) halted (retained) halted (retained) halted (reset) wdt_1 function- ing function- ing function- ing function- ing subclock operation subclock operation subclock operation halted (retained) halted (reset) wdt_0 function- ing function- ing function- ing function- ing halted (retained) subclock operation subclock operation halted (retained) halted (reset) tmr function- ing function- ing function- ing function- ing/halted (retained) halted (retained) subclock operation subclock operation halted (retained) halted (reset) tpu sci i 2 c * 2 d/a * 3 * 5 function- ing function- ing function- ing function- ing/halted (retained) halted (retained) halted (retained) halted (retained) halted (retained) halted (reset) a/d ieb * 4 function- ing function- ing function- ing function- ing/halted (reset) halted (reset) halted (reset) halted (reset) halted (reset) halted (reset) notes: ?halted (retained)? means that internal register values are retained. the internal state is ?operation suspended?. ?halted (reset)? means that internal register values and internal states are initialized. in module stop mode, only modules for which a stop setting has been made are halted (reset or retained). 1. supported only by the h8s/2239 group. 2. not available in the h8s/2237 group and h8s/2227 group. 3. not available in the h8s/2227 group.
section 24 power-down modes rev. 5.00 aug 08, 2006 page 785 of 982 rej09b0054-0500 4. supported only by the h8s/2258 group. 5. the analog output value does not satisfy the specified d/a absolute accuracy when d/a is halted (retained). however, the h8s/2258 group, h8s/2238b, and h8s/2236b satisfy the specified d/a absolute accuracy. program-halted state program execution state sck2 to sck0 = 0 sck2 to sck0 0 sleep instruction ssby = 1, pss = 1 dton = 1, lson = 1 clock switching exception processing sleep instruction ssby = 1, pss = 1 dton = 1, lson = 0 after the oscillation settling time (sts2 to 0), clock switching exception processing sleep instruction sleep instruction external interrupt * 3 all interrupt sleep instruction sleep instruction sleep instruction interrupt * 1 lson bit = 0 interrupt * 2 interrupt * 1 lson bit = 1 stby pin = high res pin = low stby pin = low ssby = 0, lson = 0 ssby = 1, pss = 0, lson = 0 ssby = 0, pss = 1, lson = 1 ssby = 1, pss = 1, dton = 0 res pin = high mres pin = high : transition after exception processing : low power dissipation mode power on reset state manual reset state reset state high-speed mode (main clock) medium-speed mode (main clock) sub-active mode (subclock) sub-sleep mode (subclock) hardware standby mode software standby mode sleep mode (main clock) watch mode (subclock) notes: 1. 2. 3. nmi, irq7 to irq0, and wdt1 interrupts. nmi, irq7 to irq0, and wdt1, wdt0, and tmr3 to tmr0 interrupts. nmi, irq7 to irq0 when a transition is made between modes by means of an interrupt, the transition cannot be made on interrupt source generation alone. ensure that interrupt handling is performed after accepting the interrupt request. from any state except hardware standby mode, a transition to the reset state occurs when res is driven low. at any state except hardware standby mode and power-on reset state, a transition to the manual reset state occurs when the mres pin is driven low. from any state, a transition to hardware standby mode occurs when stby is driven low. always select high-speed mode before making a transition to watch mode or sub-active mode. figure 24.1 mode transition diagram
section 24 power-down modes rev. 5.00 aug 08, 2006 page 786 of 982 rej09b0054-0500 table 24.2 low power dissipation mode transition conditions status of control bit at transition pre-transition state ssby pss lson dton state after transition invoked by sleep instruction state after transition back from low power mode invoked by interrupt 0 0 sleep high-speed/medium- speed high-speed/ medium-speed 0 1 ?? 100 software standby high-speed/medium- speed 101 ?? 1100watch high-s peed 1110watch s ubactive 1101? ? 1111s ubactive ? subactive 0 0 ?? 010 ?? 011 subsleep subactive 10 ?? 1100watch high-s peed 1110watch s ubactive 1101high-s peed ? 1111? ? legend: : don?t care ?: don?t set
section 24 power-down modes rev. 5.00 aug 08, 2006 page 787 of 982 rej09b0054-0500 24.1 register description the following registers relates to the power-down modes. for details on system clock control register (sckcr), refer to section 23.1.1, system clock control register (sckcr). for details on low power control register (lpwrcr), refer to section 23.1.2, low power control register (lpwrcr). for details on timer control status register (tcsr_1), refer to section 13.3.2, timer control/status register (tcsr). ? standby control register (sbycr) ? module stop control register a (mstpcra) ? module stop control register b (mstpcrb) ? module stop control register c (mstpcrc) ? low power control register (lpwrcr) ? system clock control register (sckcr) ? timer control status register (tcsr_1) 24.1.1 standby control register (sbycr) sbycr performs power-down mode control. bit bit name initial value r/w description 7 ssby 0 r/w software standby specifies transition destination when the sleep instruction is executed. 0: shifts to sleep mode when the sleep instruction is executed in high-speed mode or medium-speed mode. shifts to subsleep mode when the sleep instruction is executed in subactive mode. 1: shifts to software standby mode, subactive mode, and watch mode when the sleep instruction is executed in high-speed mode or medium-speed mode. shifts to watch mode or high-speed mode when the sleep instruction is executed in subactive mode. note that the value of the ssby bit does not change even when software standby mode is canceled and making normal operation mode transition by executing an external interrupt. to clear this bit, 0 should be written to.
section 24 power-down modes rev. 5.00 aug 08, 2006 page 788 of 982 rej09b0054-0500 bit bit name initial value r/w description 6 5 4 sts2 sts1 sts0 0 0 0 r/w r/w r/w standby timer select 2 to 0 these bits select the mcu wait time for clock settling to cancel software standby mode, watch mode, or subactive mode. with a crystal resonator (tables 24.3, 27.5, 27.17, 27.30, 27.42, 27.53), select a wait time of t osc2 ms (oscillation settling time) or more, depending on the operating frequency. with an external clock, there are no specific wait requirements. 000: standby time = 8192 states 001: standby time = 16384 states 010: standby time = 32768 states 011: standby time = 65536 states 100: standby time = 131072 states 101: standby time = 262144 states 110: reserved 111: standby time = 16 states * 3 ope 1 r/w output port enable specifies whether the output of the address bus and bus control signals ( c s 7 to c s0 , a s , rd , hw r , and lwr ) should be retained or driven to the high impedance state, when shifting to software standby mode, watch mode, or direct transition. 0: high impedance 1: output is retained. 2 to 0 ? all 0 ? reserved these bits are always read as 0 and cannot be modified. note: * don?t set 16 states for standby time in the f-ztat version. 8192 states or more should be set.
section 24 power-down modes rev. 5.00 aug 08, 2006 page 789 of 982 rej09b0054-0500 24.1.2 module stop control registers a to c (mstpcra to mstpcrc) mstpcr performs module stop mode control. when bits in mstpcr registers are set to 1, module stop mode is set. when cleared to 0, module stop mode is cleared. ? mstpcra bit bit name initial value r/w target module 7 mstpa7 0 r/w dma controller (dmac) * 2 6 mstpa6 0 r/w data transfer controller (dtc) 5 mstpa5 1 r/w 16-bit timer pulse unit (tpu) 4 mstpa4 1 r/w 8-bit timer (tmr_0, tmr_1) 3 mstpa3 * 1 1r/w 2 mstpa2 * 1 1r/w 1 mstpa1 1 r/w a/d converter 0 mstpa0 1 r/w 8-bit timer (tmr_2 * 3 , tmr_3 * 3 ) ? mstpcrb bit bit name initial value r/w target module 7 mstpb7 1 r/w serial communication interface 0 (sci_0) 6 mstpb6 1 r/w serial communication interface 1 (sci_1) 5 mstpb5 1 r/w serial communication interface 2 (sci_2) * 4 4 mstpb4 1 r/w i 2 c bus interface 0 (iic_0) (optional) * 3 3 mstpb3 1 r/w i 2 c bus interface 1 (iic_1) (optional) * 3 2 mstpb2 * 1 1r/w 1 mstpb1 * 1 1r/w 0 mstpb0 * 1 1r/w
section 24 power-down modes rev. 5.00 aug 08, 2006 page 790 of 982 rej09b0054-0500 ? mstpcrc bit bit name initial value r/w target module 7 mstpc7 1 r/w serial communication interface 3 (sci_3) 6mstpc6 * 1 1r/w 5 mstpc5 1 r/w d/a converter * 4 4 mstpc4 1 r/w pc break controller (pbc) 3 mstpc3 1 r/w iebus controller (ieb) * 5 2mstpc2 * 1 1r/w 1mstpc1 * 1 1r/w 0mstpc0 * 1 1r/w notes: 1. bits mstpa3, mstpa2, mstpb5, mstpb2 to mstpb0, mstpc6, mstpc2 to mstpc0 are readable/writable. the initial value of them is 1. the write value should always be 1. 2. supported only by the h8s/2239 group. 3. not available in the h8s/2237 group and h8s/2227 group. 4. not available in the h8s/2227 group. 5. supported only by the h8s/2258 group. 24.2 medium-speed mode in high-speed mode, when the sck2 to sck0 bits in sckcr are set to 1, the operating mode changes to medium-speed mode as soon as the current bus cycle ends. in medium-speed mode, the cpu operates on the operating clock ( /2, /4, /8, /16, or /32) specified by the sck2 to sck0 bits. the bus masters other than the cpu (dmac* and dtc) also operate in medium-speed mode. on-chip peripheral modules other than the bus masters always operate on the high-speed clock ( ). in medium-speed mode, a bus access is executed in the specified number of states with respect to the bus master operating clock. for example, if /4 is selected as the operating clock, on-chip memory is accessed in 4 states, and internal i/o registers in 8 states. medium-speed mode is cleared by clearing all of bits sck2 to sck0 to 0. a transition is made to high-speed mode and medium-speed mode is cleared at the end of the current bus cycle. if a sleep instruction is executed when the ssby bit in sbycr is cleared to 0, and lson bit in lpwrcr is cleared to 0, a transition is made to sleep mode. when sleep mode is cleared by an interrupt, medium-speed mode is restored.
section 24 power-down modes rev. 5.00 aug 08, 2006 page 791 of 982 rej09b0054-0500 when the sleep instruction is executed with the ssby bit = 1, the lson bit in lpwrcr = 0, and the pss bit in tcsr_1 (wdt_1) = 0, operation shifts to the software standby mode. when software standby mode is cleared by an external interrupt, medium-speed mode is restored. when the res or mres pin is set low and medium-speed mode is cancelled, operation shifts to the reset state. the same applies in the case of a reset caused by overflow of the watchdog timer. when the stby pin is driven low, a transition is made to hardware standby mode. figure 24.2 shows the timing for transition to and clearance of medium-speed mode. note: * supported only by the h8s/2239 group. , peripheral module clock bus master clock internal address bus internal write signal medium-speed mode sckcr sckcr figure 24.2 medium-speed mode transition and clearance timing 24.3 sleep mode 24.3.1 transition to sleep mode when the sleep instruction is executed while the ssby bit in sbycr = 0 and the lson bit in lpwrcr = 0, the cpu enters the sleep mode. in sleep mode, cpu operation stops but the contents of the cpu?s internal registers are retained. other peripheral modules do not stop.
section 24 power-down modes rev. 5.00 aug 08, 2006 page 792 of 982 rej09b0054-0500 24.3.2 exiting sleep mode sleep mode is exited by any interrupt, or signals at the res pin, mres pin, or stby pin. ? exiting sleep mode by interrupts when an interrupt occurs, sleep mode is exited and interrupt exception processing starts. sleep mode is not exited if the interrupt is disabled, or interrupts other than nmi are masked by the cpu. ? exiting sleep mode by res pin or mres pin setting the res pin or mres pin level low selects the reset state. after the stipulated reset input duration, driving the res pin or mres pin high starts the cpu performing reset exception processing. ? exiting sleep mode by stby pin when the stby pin level is driven low, a transition is made to hardware standby mode. 24.4 software standby mode 24.4.1 transition to software standby mode a transition is made to software standby mode when the sleep instruction is executed while the ssby bit in sbycr = 1 and the lson bit in lpwrcr = 0, and the pss bit in tcsr_1 (wdt_1) = 0. in this mode, the cpu, on-chip peripheral modules, and system clock oscillator all stop. however, the contents of the cpu?s internal registers, ram data, and the states of on-chip peripheral modules other than sci and the a/d converter, and the states of i/o ports are retained. in this mode the oscillator stops, and therefore power dissipation is significantly reduced. 24.4.2 clearing software standby mode software standby mode is cleared by an external interrupt (nmi pin, or pins irq7 to irq0 ), or by means of the mres pin or stby pin. ? clearing with an interrupt when an nmi, or irq7 to irq0 interrupt request signal is input, clock oscillation starts, and after the elapse of the time set in bits sts2 to sts0 in syscr, stable clocks are supplied to the entire this lsi chip, software standby mode is cleared, and interrupt exception handling is started. when clearing software standby mode with an irq7 to irq0 interrupt, set the corresponding enable bit/pin function switching bit to 1 and ensure that no interrupt with a higher priority
section 24 power-down modes rev. 5.00 aug 08, 2006 page 793 of 982 rej09b0054-0500 than interrupts irq7 to irq0 is generated. software standby mode cannot be cleared if the interrupt has been masked on the cpu side or has been designated as a dtc activation source. ? clearing with the res pin or mres pin when the res pin or mres pin is driven low, clock oscillation is started. at the same time as clock oscillation starts, clocks are supplied to the entire this lsi chip. note that the res pin or mres pin must be held low until clock oscillation settles. when the res pin or mres pin goes high, the cpu begins reset exception handling. ? clearing with the stby pin when the stby pin is driven low, a transition is made to hardware standby mode. 24.4.3 oscillation settling time after clearing software standby mode bits sts2 to sts0 in sbycr should be set as described below. ? using a crystal oscillator set bits sts2 to sts0 so that the standby time is at least tosc2 ms (the oscillation settling time). table 24.3 shows the standby times for different operating frequencies and settings of bits sts2 to sts0. ? using an external clock any value can be set. normally, minimum time is recommended. note: do not set 16 states for standby time in the f-ztat version. 8192 states or more should be set. table 24.3 oscillation settling time settings sts2 sts1 sts0 standby time 20 mhz * 1 16 mhz * 1 13 mhz 10 mhz 8 mhz * 2 6 mhz * 2 4 mhz * 2 2 mhz * 2 unit 0 0 0 8192 states 0.41 0.51 0.6 0.8 1.0 1.4 2.0 4.1 ms 1 16384 states 0.82 1.0 1.3 1.6 2.0 2.7 4.1 8.2 1 0 32768 states 1.6 2.0 2.5 3.3 4.1 5.5 8.2 16.4 1 65536 states 3.3 4.1 5.0 6.6 8.2 10.9 16.4 32.8 1 0 0 131072 states 6.6 8.2 10.1 13.1 16.4 21.8 32.8 65.5 1 262144 states 13.1 16.4 20.2 26.2 32.8 43.7 65.5 131.1 10reserved ????????? 1 16 states 0.8 1.0 1.2 1.6 2.0 2.7 4.0 8.0 s : recommended time setting notes: 1. supported only by the h8s/2239 group. 2. the h8s/2258 group is out of operation.
section 24 power-down modes rev. 5.00 aug 08, 2006 page 794 of 982 rej09b0054-0500 24.4.4 software standby mode application example figure 24.3 shows an example in which a transition is made to software standby mode at the falling edge on the nmi pin, and software standby mode is cleared at the rising edge on the nmi pin. in this example, an nmi interrupt is accepted with the nmieg bit in syscr cleared to 0 (falling edge specification), then the nmieg bit is set to 1 (rising edge specification), the ssby bit is set to 1, and a sleep instruction is executed, causing a transition to software standby mode. software standby mode is then cleared at the rising edge on the nmi pin. oscillator nmi nmieg ssby nmi exception handling nmieg = 1 ssby = 1 sleep instruction software standby mode (power-down mode) oscillation settling time t osc2 nmi exception handling figure 24.3 software standby mode application example
section 24 power-down modes rev. 5.00 aug 08, 2006 page 795 of 982 rej09b0054-0500 24.5 hardware standby mode 24.5.1 transition to hardware standby mode when the stby pin is driven low, a transition is made to hardware standby mode from any mode. in hardware standby mode, all functions enter the reset state and stop operation, resulting in a significant reduction in power dissipation. as long as the prescribed voltage is supplied, on-chip ram data is retained. i/o ports are set to the high-impedance state. do not change the state of the mode pins (md2 to md0) while this lsi is in hardware standby mode. 24.5.2 clearing hardware standby mode hardware standby mode is cleared by means of the stby pin and the res pin. when the stby pin is driven high while the res pin is low, the reset state is set and clock oscillation is started. ensure that the res pin is held low until the clock oscillator settles (at least tosc1 ms?the oscillation settling time?when using a crystal oscillator). when the res pin is subsequently driven high, a transition is made to the program execution state via the reset exception handling state. 24.5.3 hardware standby mode timing figure 24.4 shows an example of hardware standby mode timing. when the stby pin is driven low after the res pin has been driven low, a transition is made to hardware standby mode. hardware standby mode is cleared by driving the stby pin high, waiting for the oscillation settling time, then changing the res pin from low to high.
section 24 power-down modes rev. 5.00 aug 08, 2006 page 796 of 982 rej09b0054-0500 oscillator res stby oscillation settling time t osc1 reset exception handling figure 24.4 hardware standby mode timing 24.6 module stop mode module stop mode can be set for individual on-chip peripheral modules. when the corresponding mstp bit in mstpcr is set to 1, module operation stops at the end of the bus cycle and a transition is made to module stop mode. the cpu continues operating independently. when the corresponding mstp bit is cleared to 0, module stop mode is cleared and the module starts operating at the end of the bus cycle. in module stop mode, the internal states of modules other than sci and the a/d converter are retained. after reset clearance, all modules other than dmac* and dtc are in module stop mode. when an on-chip peripheral module is in module stop mode, read/write access to its registers is disabled. since the operations of the bus controller and i/o port are stopped when sleep mode is entered at the all-module stop state (mstpcr = h'ffffffff), power consumption can further be reduced. note: * supported only by the h8s/2239 group.
section 24 power-down modes rev. 5.00 aug 08, 2006 page 797 of 982 rej09b0054-0500 24.7 watch mode 24.7.1 transition to watch mode cpu operation makes a transition to watch mode when the sleep instruction is executed in high- speed mode or subactive mode with ssby in sbycr = 1, dton in lpwrcr = 0, and pss in tcsr_1 (wdt_1) = 1. in watch mode, the cpu is stopped and peripheral modules other than wdt_1 and system clock oscillator are also stopped. the contents of the cpu?s internal registers, the data in internal ram, and the statuses of the internal peripheral modules (excluding sci and the a/d converter) and i/o ports are retained. to make a transition to watch mode, bits sck2 to sck0 in sckcr must be set to 0. 24.7.2 exiting watch mode watch mode is exited by any interrupt (wovi_1 interrupt, nmi pin, or irq7 to irq0 ), or signals at the res , mres , or stby pin. ? exiting watch mode by interrupts when an interrupt occurs, watch mode is exited and a transition is made to high-speed mode or medium-speed mode when the lpwrcr lson bit = 0 or to subactive mode when the lson bit = 1. when a transition is made to high-speed mode, a stable clock is supplied to all lsi circuits and interrupt exception processing starts after the time set in sbycr sts2 to sts0 has elapsed. in the case of irq7 to irq0 interrupts, no transition is made from watch mode if the corresponding enable bit/pin function switching bit has been cleared to 0, and, in the case of interrupts from the internal peripheral modules, the interrupt enable register has been set to disable the reception of that interrupt, or is masked by the cpu. see section 24.4.3, oscillation settling time after clearing software standby mode, for how to set the oscillation settling time when making a transition from watch mode to high-speed mode. ? exiting watch mode by res pin or mres pin for exiting watch mode by the res or mres pin, see section 24.4.2, clearing software standby mode. ? exiting watch mode by stby pin when the stby pin level is driven low, a transition is made to hardware standby mode.
section 24 power-down modes rev. 5.00 aug 08, 2006 page 798 of 982 rej09b0054-0500 24.8 subsleep mode 24.8.1 transition to subsleep mode when the sleep instruction is executed with the ssby bit in sbycr = 0, the lson bit in lpwrcr = 1, and the pss bit in tcsr_1 (wdt_1) = 1 in subactive mode, cpu operation shifts to subsleep mode. in subsleep mode, the cpu is stopped. peripheral modules other than tmr_0 to tmr3, wdt_0, and wdt_1 and system clock oscillator are also stopped. the contents of the cpu?s internal registers, the data in internal ram, and the statuses of the internal peripheral modules (excluding the sci and the a/d converter) and i/o ports are retained. 24.8.2 exiting subsleep mode ? subsleep mode is exited by an interrupt (interrupts from internal peripheral modules, nmi pin, or irq7 to irq0 ), or signals at the res or stby pin. ? exiting subsleep mode by interrupts when an interrupt occurs, subsleep mode is exited and interrupt exception processing starts. in the case of irq7 to irq0 interrupts, subsleep mode is not cancelled if the corresponding enable bit/pin function switching bit has been cleared to 0, and, in the case of interrupts from the internal peripheral modules, the interrupt enable register has been set to disable the reception of that interrupt, or is masked by the cpu. ? exiting subsleep mode by res pin or mres pin for exiting subsleep mode by the res or mres pin, see section 24.4.2, clearing software standby mode. ? exiting subsleep mode by stby pin when the stby pin or mres pin level is driven low, a transition is made to hardware standby mode.
section 24 power-down modes rev. 5.00 aug 08, 2006 page 799 of 982 rej09b0054-0500 24.9 subactive mode 24.9.1 transition to subactive mode when the sleep instruction is executed in high-speed mode with the ssby bit in sbycr = 1, the dton bit in lpwrcr = 1, the lson bit = 1, and the pss bit in tcsr_1 (wdt_1) = 1, cpu operation shifts to subactive mode. when an interrupt occurs in watch mode, and if the lson bit of lpwrcr is 1, a transition is made to subactive mode. and if an interrupt occurs in subsleep mode, a transition is made to subactive mode. in subactive mode, the cpu operates at low speed on the subclock, and the program is executed step by step. peripheral modules other than pbc, tmr_0 to tmr_3, wdt_0, and wdt_1, and system clock oscillator are also stopped. when operating the cpu in subactive mode, the sckcr sck2 to sck0 bits must be set to 0. 24.9.2 exiting subactive mode subactive mode is exited by the sleep instruction or the res , mres or stby pin. ? exiting subactive mode by sleep instruction when the sleep instruction is executed with the ssby bit in sbycr = 1, the dton bit in lpwrcr = 0, and the pss bit in tcsr_1 (wdt_1) = 1, the cpu exits subactive mode and a transition is made to watch mode. when the sleep instruction is executed with the ssby bit in sbycr = 0, the lson bit in lpwrcr = 1, and the pss bit in tcsr_1 (wdt_1) = 1, a transition is made to subsleep mode. finally, when the sleep instruction is executed with the ssby bit in sbycr = 1, the dton bit in lpwrcr = 1, the lson bit = 0, and the pss bit in tcsr_1 (wdt_1) = 1, a direct transition is made to high-speed mode (sck2 to sck0 all 0). ? exiting subactive mode by res pin or mres pin for exiting subactive mode by the res or mres pin, see section 24.4.2, clearing software standby mode. ? exiting subactive mode by stby pin when the stby pin level is driven low, a transition is made to hardware standby mode.
section 24 power-down modes rev. 5.00 aug 08, 2006 page 800 of 982 rej09b0054-0500 24.10 direct transitions there are three modes, high-speed, medium-speed, and subactive, in which the cpu executes programs. when a direct transition is made, there is no interruption of program execution when shifting between high-speed and subactive modes. direct transitions are enabled by setting the lpwrcr dton bit to 1, then executing the sleep instruction. after a transition, direct transition interrupt exception processing starts. 24.10.1 direct transitions from high-speed mode to subactive mode execute the sleep instruction in high-speed mode when the ssby bit in sbycr = 1, the lson bit in lpwrcr = 1, and the dton bit = 1, and the pss bit in tscr_1 (wdt_1) = 1 to make a transition to subactive mode. 24.10.2 direct transitions from subactive mode to high-speed mode execute the sleep instruction in subactive mode when the ssby bit in sbycr = 1, the lson bit in lpwrcr = 0, and the dton bit = 1, and the pss bit in tscr_1 (wdt_1) = 1 to make a direct transition to high-speed mode after the time set in sts2 to sts0 bits in sbycr has elapsed. 24.11 clock output enable the pstop bit in sckcr and the ddr of the corresponding port control the clock output. when the pstop bit is set to 1, clock stops at the end of the bus cycle and the clock output is fixed high. when the pstop bit is cleared to 0, the clock output is enabled. when the ddr of the corresponding port is cleared to 0, the clock output is disabled and it functions as an input port. table 24.4 lists the pin states in respective process. table 24.4 pin states in respective processes ddr 0 1 1 pstop ? 01 hardware standby mode high impedance high impedance high impedance software standby mode, watch mode, direct transition high impedance fixed to high fixed high sleep mode, subsleep mode high impedance output fixed high high-speed mode, medium- speed mode, subactive mode high impedance output fixed high
section 24 power-down modes rev. 5.00 aug 08, 2006 page 801 of 982 rej09b0054-0500 24.12 usage notes 24.12.1 i/o port status in software standby mode and watch mode, i/o port states are retained. therefore, there is no reduction in current dissipation for the output current when a high-level signal is output. 24.12.2 current dissipation during oscillation settling wait period current dissipation increases during the oscillation settling wait period. 24.12.3 dtc and dmac * module stop depending on the operating status of the dtc and dmac*, the mstpa6 bit and mstpa7 bit may not be set to 1. setting of the dtc and dmac* module stop mode should be carried out only when the respective module is not activated. for details, refer to section 8, dma controller (dmac) and section 9, data transfer controller (dtc). note: * supported only by the h8s/2239 group. 24.12.4 on-chip peripheral module interrupt ? module stop mode relevant interrupt operations cannot be performed in module stop mode. consequently, if module stop mode is entered when an interrupt has been requested, it will not be possible to clear the cpu interrupt source or the dmac * 1 or dtc activation source. interrupts should therefore be disabled before entering module stop mode. ? subactive mode/watch mode on-chip peripheral modules (dmac * 1 , dtc, tpu, iic * 2 ) that stop operation in subactive mode cannot clear interrupts in subactive mode. therefore, if subactive mode is entered when an interrupt is requested, cpu interrupt factors cannot be cleared. interrupts should therefore before executing the sleep instruction and entering subactive or watch mode. notes: 1. supported only by the h8s/2239 group. 2. not available in the h8s/2237 group and h8s/2227 group.
section 24 power-down modes rev. 5.00 aug 08, 2006 page 802 of 982 rej09b0054-0500 24.12.5 writing to mstpcr mstpcr should only be written to by the cpu. 24.12.6 entering subactive/watch mode and dmac * and dtc module stop to enter subactive or watch mode, set dmac* and dtc to module stop (write 1 to the mstpa6 bit and mstpa7 bit) and reading the mstpa6 bit and mstpa7 bit as 1 before transiting mode. after transiting from subactive mode to active mode, clear module stop. when dmac* or dtc activation factor occurs in subactive mode, dmac* or dtc is activated when module stop is cleared after active mode is entered. note: * supported only by the h8s/2239 group.
section 25 power supply circuit rev. 5.00 aug 08, 2006 page 803 of 982 rej09b0054-0500 section 25 power supply circuit 25.1 overview the h8s/2258 group, h8s/2238b, and h8s/2236b incorporates an internal power supply step- down circuit. use of this circuit enables the internal power supply to be fixed at a constant level of approximately 3.0 v, independently of the voltage of the power supply connected to the external v cc pin. as a result, the current consumed when an external power supply is used at 3.0 v or above can be held down to virtually the same low level as when used at approximately 3.0 v. if the external power supply is 3.0 v or below, the internal voltage will be practically the same as the external voltage. the h8s/2239 group, h8s/2238r, h8s/2236r, h8s/2237 group, and h8s/2227 group do not have an on-chip internal power supply voltage step-down circuit. an external power supply should be connected to the v cc and cv cc pins. 25.2 power supply connection for h8s/2258 group, h8s/2238b, and h8s/2236b (on-chip internal power supply step-down circuit) connect the external power supply to the v cc pin, and connect a capacitance of approximately 0.1 f between cv cc and v ss , as shown in figure 25.1. the internal step-down circuit is made effective simply by adding this external circuit. permanent damage on the chip may result if the absolute maximum rating of cv cc 4.3 v is exceeded. must not connect the external power supply to the cv cc pin. notes: 1. in the external circuit interface, the external power supply voltage connected to v cc and the gnd potential connected to v ss are the reference levels. for example, for port input/output levels, the v cc level is the reference for the high level, and the v ss level is that for the low level. 2. the a/d converter and d/a converter analog power supply are not affected by internal step-down processing.
section 25 power supply circuit rev. 5.00 aug 08, 2006 page 804 of 982 rej09b0054-0500 cv cc v ss internal logic step-down circuit internal power supply stabilization capacitance (approx. 0.1 f) v cc h8s/2258 group: v cc = 4.0 v to 5.5 v h8s/2238b, h8s/2236b: v cc = 2.7 v to 5.5 v (in the f-ztat version, v cc = 3.0 v to 5.5 v) figure 25.1 power supply connection for h8s/2258 group, h8s/2238b, and h8s/2236b (on-chip internal power supply step-down circuit) 25.3 power supply connection for h8s/2239 group, h8s/2238r, h8s/2236r, h8s/2237 group, and h8s/2227 group (no internal power supply step-down circuit) the h8s/2239 group, h8s/2238r, h8s/2236r, h8s/2237 group, and h8s/2227 group do not have an on-chip internal power supply voltage step-down circuit. connect the external power supply to the v cc pin and cv cc pin, as shown in figure 25.2. the external power supply is then input directly to the internal power supply. note: the permissible range for the power supply voltage is 2.2 v to 3.6 v (in the f-ztat version, 2.7 v to 3.6 v). operation cannot be guaranteed if a voltage outside this range (less than 2.2 v or more than 3.6 v) is input. cv cc v ss internal logic internal power supply v cc v cc = 2.2 v to 3.6 v (in the f-ztat version, v cc = 2.7 v to 3.6 v) figure 25.2 power supply connection for h8s/2239 group, h8s/2238r, h8s/2236r, h8s/2237 group, and h8s/2227 group (no internal power supply step-down circuit)
section 25 power supply circuit rev. 5.00 aug 08, 2006 page 805 of 982 rej09b0054-0500 25.4 note on bypass capacitor a laminated ceramic capacitor of 0.01 f to 0.1 f should be inserted as a bypass capacitor in each pair of v ss and v cc . the bypass capacitor should be placed as close as possible to the power supply pin of this lsi. the capacitance value and frequency characteristics should be used according to the operating frequency of this lsi.
section 25 power supply circuit rev. 5.00 aug 08, 2006 page 806 of 982 rej09b0054-0500
section 26 list of registers rev. 5.00 aug 08, 2006 page 807 of 982 rej09b0054-0500 section 26 list of registers this section gives information on the on-chip i/o registers and is configured as described below. 1. register addresses (in address order) ? descriptions by functional module, in ascending order of addresses ? descriptions by functional module ? the number of access states are given 2. register bits ? bit configurations of the registers are described in the same order as the register addresses (in address order) ? reserved bits are indicated by ? ? ? in the bit name ? a blank in the bit name indicates that the corresponding whole register is allocated to the counter or data 3. register states in each operating mode ? register states are described in the same order as the register addresses (in address order) ? the register states described are for the basic operating modes. if there is a specific reset for an on-chip module, refer to the section on that on-chip module 26.1 register addresses (in address order) the data bus width indicates the number of bits by which the register is accessed. the number of access states indicates the number of states based on the specified reference clock.
section 26 list of registers rev. 5.00 aug 08, 2006 page 808 of 982 rej09b0054-0500 register name abbrevia- tion bit no. address * 1 module data bus width access state dtc mode register a mra 8 dtc 16/32 * 2 2 dtc mode register b mrb 8 h'ebc0 to h'efbf dtc 16/32 * 2 2 dtc source address register sar 24 dtc 16/32 * 2 2 dtc destination address register dar 24 dtc 16/32 * 2 2 dtc transfer count register a cra 16 dtc 16/32 * 2 2 dtc transfer count register b crb 16 dtc 16/32 * 2 2 iebus control register iectr 8 ieb 8 2 iebus command register iecmr 8 h'f800 to h'f816 ieb 8 2 iebus master control register iemcr 8 ieb 8 2 iebus master unit address register 1 iear1 8 ieb 8 2 iebus master unit address register 2 iear2 8 ieb 8 2 iebus slave address setting register 1 iesa1 8 ieb 8 2 iebus slave address setting register 2 iesa2 8 ieb 8 2 iebus transmit message length register ietbfl 8 ieb 8 2 iebus transmit buffer register ietbr 8 ieb 8 2 iebus reception master address register 1 iema1 8 ieb 8 2 iebus reception master address register 2 iema2 8 ieb 8 2 iebus receive control field register ierctl 8 ieb 8 2 iebus receive message length register ierbfl 8 ieb 8 2 iebus receive buffer register ierbr 8 ieb 8 2 iebus lock address register 1 iela1 8 ieb 8 2 iebus lock address register 2 iela2 8 ieb 8 2 iebus general flag register ieflg 8 ieb 8 2 iebus transmit/runaway status register ietsr 8 ieb 8 2 iebus transmit/runaway interrupt enable register ieiet 8 ieb 8 2
section 26 list of registers rev. 5.00 aug 08, 2006 page 809 of 982 rej09b0054-0500 register name abbrevia- tion bit no. address * 1 module data bus width access state iebus transmit error flag register ietef 8 h'f800 to h'f816 ieb 8 2 iebus receive status register iersr 8 ieb 8 2 iebus receive interrupt enable register ieier 8 ieb 8 2 iebus receive error flag register ieref 8 ieb 8 2 d/a data register_0 dadr_0 8 h'fdac d/a converter 82 d/a data register_1 dadr_1 8 h'fdad d/a converter 82 d/a control register dacr 8 h'fdae d/a converter 82 serial control register x scrx 8 h'fdb4 iic, flash 82 ddc switch register ddcswr 8 h'fdb5 iic 8 2 timer control register_2 tcr_2 8 h'fdc0 tmr_2 8 2 timer control register_3 tcr_3 8 h'fdc1 tmr_3 8 2 timer control/status register_2 tcsr_2 8 h'fdc2 tmr_2 8 2 timer control/status register_3 tcsr_3 8 h'fdc3 tmr_3 8 2 time constant register a_2 tcora_2 8 h'fdc4 tmr_2 8/16 2 time constant register a_3 tcora_3 8 h'fdc5 tmr_3 8/16 2 time constant register b_2 tcorb_2 8 h'fdc6 tmr_2 8/16 2 time constant register b_3 tcorb_3 8 h'fdc7 tmr_3 8/16 2 timer counter_2 tcnt_2 8 h'fdc8 tmr_2 8/16 2 timer counter_3 tcnt_3 8 h'fdc9 tmr_3 8/16 2 serial mode register_3 smr_3 8 h'fdd0 sci_3 8 2 bit rate register_3 brr_3 8 h'fdd1 sci_3 8 2 serial control register_3 scr_3 8 h'fdd2 sci_3 8 2 transmit data register_3 tdr_3 8 h'fdd3 sci_3 8 2 serial status register_3 ssr_3 8 h'fdd4 sci_3 8 2 receive data register_3 rdr_3 8 h'fdd5 sci_3 8 2 smart card mode register_3 scmr_3 8 h'fdd6 sci_3 8 2 standby control register sbycr 8 h'fde4 system 8 2 system control register syscr 8 h'fde5 system 8 2
section 26 list of registers rev. 5.00 aug 08, 2006 page 810 of 982 rej09b0054-0500 register name abbrevia- tion bit no. address * 1 module data bus width access state system clock control register sckcr 8 h'fde6 system 8 2 mode control register mdcr 8 h'fde7 system 8 2 module stop control register a mstpcra 8 h'fde8 system 8 2 module stop control register b mstpcrb 8 h'fde9 system 8 2 module stop control register c mstpcrc 8 h'fdea system 8 2 pin function control register pfcr 8 h'fdeb bsc 8 2 low power control register lpwrcr 8 h'fdec system 8 2 serial expansion mode register 0 semr_0 8 h'fdf8 sci_0 8 2 break address register a bara 32 h'fe00 pbc 8/16 2 break address register b barb 32 h'fe04 pbc 8/16 2 break control register a bcra 8 h'fe08 pbc 8/16 2 break control register b bcrb 8 h'fe09 pbc 8/16 2 irq sense control register h iscrh 8 h'fe12 int 8 2 irq sense control register l iscrl 8 h'fe13 int 8 2 irq enable register ier 8 h'fe14 int 8 2 irq status register isr 8 h'fe15 int 8 2 dtc enable register a dtcera 8 h'fe16 dtc 8 2 dtc enable register b dtcerb 8 h'fe17 dtc 8 2 dtc enable register c dtcerc 8 h'fe18 dtc 8 2 dtc enable register d dtcerd 8 h'fe19 dtc 8 2 dtc enable register e dtcere 8 h'fe1a dtc 8 2 dtc enable register f dtcerf 8 h'fe1b dtc 8 2 dtc enable register i dtceri 8 h'fe1e dtc 8 2 dtc vector register dtvecr 8 h'fe1f dtc 8 2 port 1 data direction register p1ddr 8 h'fe30 port 8 2 port 3 data direction register p3ddr 8 h'fe32 port 8 2 port 7 data direction register p7ddr 8 h'fe36 port 8 2 port a data direction register paddr 8 h'fe39 port 8 2 port b data direction register pbddr 8 h'fe3a port 8 2 port c data direction register pcddr 8 h'fe3b port 8 2 port d data direction register pdddr 8 h'fe3c port 8 2 port e data direction register peddr 8 h'fe3d port 8 2
section 26 list of registers rev. 5.00 aug 08, 2006 page 811 of 982 rej09b0054-0500 register name abbrevia- tion bit no. address * 1 module data bus width access state port f data direction register pfddr 8 h'fe3e port 8 2 port g data direction register pgddr 8 h'fe3f port 8 2 port a pull-up mos control register papcr 8 h'fe40 port 8 2 port b pull-up mos control register pbpcr 8 h'fe41 port 8 2 port c pull-up mos control register pcpcr 8 h'fe42 port 8 2 port d pull-up mos control register pdpcr 8 h'fe43 port 8 2 port e pull-up mos control register pepcr 8 h'fe44 port 8 2 port 3 open drain control register p3odr 8 h'fe46 port 8 2 port a open drain control register paodr 8 h'fe47 port 8 2 timer control register_3 tcr_3 8 h'fe80 tpu_3 8 2 timer mode register_3 tmdr_3 8 h'fe81 tpu_3 8 2 timer i/o control register h_3 tiorh_3 8 h'fe82 tpu_3 8 2 timer i/o control register l_3 tiorl_3 8 h'fe83 tpu_3 8 2 timer interrupt enable register_3 tier_3 8 h'fe84 tpu_3 8 2 timer status register_3 tsr_3 8 h'fe85 tpu_3 8 2 timer counter_3 tcnt_3 16 h'fe86 tpu_3 16 2 timer general register a_3 tgra_3 16 h'fe88 tpu_3 16 2 timer general register b_3 tgrb_3 16 h'fe8a tpu_3 16 2 timer general register c_3 tgrc_3 16 h'fe8c tpu_3 16 2 timer general register d_3 tgrd_3 16 h'fe8e tpu_3 16 2 timer control register_4 tcr_4 8 h'fe90 tpu_4 8 2 timer mode register_4 tmdr_4 8 h'fe91 tpu_4 8 2 timer i/o control register_4 tior_4 8 h'fe92 tpu_4 8 2 timer interrupt enable register_4 tier_4 8 h'fe94 tpu_4 8 2 timer status register_4 tsr_4 8 h'fe95 tpu_4 8 2 timer counter_4 tcnt_4 16 h'fe96 tpu_4 16 2 timer general register a_4 tgra_4 16 h'fe98 tpu_4 16 2 timer general register b_4 tgrb_4 16 h'fe9a tpu_4 16 2
section 26 list of registers rev. 5.00 aug 08, 2006 page 812 of 982 rej09b0054-0500 register name abbrevia- tion bit no. address * 1 module data bus width access state timer control register_5 tcr_5 8 h'fea0 tpu_5 8 2 timer mode register_5 tmdr_5 8 h'fea1 tpu_5 8 2 timer i/o control register_5 tior_5 8 h'fea2 tpu_5 8 2 timer interrupt enable register_5 tier_5 8 h'fea4 tpu_5 8 2 timer status register_5 tsr_5 8 h'fea5 tpu_5 8 2 timer counter_5 tcnt_5 16 h'fea6 tpu_5 16 2 timer general register a_5 tgra_5 16 h'fea8 tpu_5 16 2 timer general register b_5 tgrb_5 16 h'feaa tpu_5 16 2 timer start register tstr 8 h'feb0 tpu 8 2 timer synchro register tsyr 8 h'feb1 tpu 8 2 interrupt priority register a ipra 8 h'fec0 int 8 2 interrupt priority register b iprb 8 h'fec1 int 8 2 interrupt priority register c iprc 8 h'fec2 int 8 2 interrupt priority register d iprd 8 h'fec3 int 8 2 interrupt priority register e ipre 8 h'fec4 int 8 2 interrupt priority register f iprf 8 h'fec5 int 8 2 interrupt priority register g iprg 8 h'fec6 int 8 2 interrupt priority register h iprh 8 h'fec7 int 8 2 interrupt priority register i ipri 8 h'fec8 int 8 2 interrupt priority register j iprj 8 h'fec9 int 8 2 interrupt priority register k iprk 8 h'feca int 8 2 interrupt priority register l iprl 8 h'fecb int 8 2 interrupt priority register o ipro 8 h'fece int 8 2 bus width control register abwcr 8 h'fed0 bsc 8 2 access state control register astcr 8 h'fed1 bsc 8 2 wait control register h wcrh 8 h'fed2 bsc 8 2 wait control register l wcrl 8 h'fed3 bsc 8 2 bus control register h bcrh 8 h'fed4 bsc 8 2 bus control register l bcrl 8 h'fed5 bsc 8 2 ram emulation register ramer 8 h'fedb flash 8 2 memory address register_0ah mar_0ah 16 h'fee0 dmac 16 2 memory address register_0al mar_0al 16 h'fee2 dmac 16 2
section 26 list of registers rev. 5.00 aug 08, 2006 page 813 of 982 rej09b0054-0500 register name abbrevia- tion bit no. address * 1 module data bus width access state i/o address register_0a ioar_0a 16 h'fee4 dmac 16 2 execute transfer count register_0a etcr_0a 16 h'fee6 dmac 16 2 memory address register_0bh mar_0bh 16 h'fee8 dmac 16 2 memory address register_0bl mar_0bl 16 h'feea dmac 16 2 i/o address eegister_0b ioar_0b 16 h'feec dmac 16 2 execute transfer count register_0b etcr_0b 16 h'feee dmac 16 2 memory address register_1ah mar_1ah 16 h'fef0 dmac 16 2 memory address register_1al mar_1al 16 h'fef2 dmac 16 2 i/o address register_1a ioar_1a 16 h'fef4 dmac 16 2 execute transfer count register_1a etcr1a 16 h'fef6 dmac 16 2 memory address register_1bh mar_1bh 16 h'fef8 dmac 16 2 memory address register_1bl mar_1bl 16 h'fefa dmac 16 2 i/o address register_1b ioar_1b 16 h'fefc dmac 16 2 execute transfer count register_1b etcr_1b 16 h'fefe dmac 16 2 port 1 data register p1dr 8 h'ff00 port 8 2 port 3 data register p3dr 8 h'ff02 port 8 2 port 7 data register p7dr 8 h'ff06 port 8 2 port a data register padr 8 h'ff09 port 8 2 port b data register pbdr 8 h'ff0a port 8 2 port c data register pcdr 8 h'ff0b port 8 2 port d data register pddr 8 h'ff0c port 8 2 port e data register pedr 8 h'ff0d port 8 2 port f data register pfdr 8 h'ff0e port 8 2 port g data register pgdr 8 h'ff0f port 8 2 timer control register_0 tcr_0 8 h'ff10 tpu_0 8 2 timer mode register_0 tmdr_0 8 h'ff11 tpu_0 8 2 timer i/o control register h_0 tiorh_0 8 h'ff12 tpu_0 8 2 timer i/o control register l_0 tiorl_0 8 h'ff13 tpu_0 8 2 timer interrupt enable register_0 tier_0 8 h'ff14 tpu_0 8 2 timer status register_0 tsr_0 8 h'ff15 tpu_0 8 2 timer counter_0 tcnt_0 16 h'ff16 tpu_0 16 2 timer general register a_0 tgra_0 16 h'ff18 tpu_0 16 2
section 26 list of registers rev. 5.00 aug 08, 2006 page 814 of 982 rej09b0054-0500 register name abbrevia- tion bit no. address * 1 module data bus width access state timer general register b_0 tgrb_0 16 h'ff1a tpu_0 16 2 timer general register c_0 tgrc_0 16 h'ff1c tpu_0 16 2 timer general register d_0 tgrd_0 16 h'ff1e tpu_0 16 2 timer control register_1 tcr_1 8 h'ff20 tpu_1 8 2 timer mode register_1 tmdr_1 8 h'ff21 tpu_1 8 2 timer i/o control register_1 tior_1 8 h'ff22 tpu_1 8 2 timer interrupt enable register_1 tier_1 8 h'ff24 tpu_1 8 2 timer status register_1 tsr_1 8 h'ff25 tpu_1 8 2 timer counter_1 tcnt_1 16 h'ff26 tpu_1 16 2 timer general register a_1 tgra_1 16 h'ff28 tpu_1 16 2 timer general register b_1 tgrb_1 16 h'ff2a tpu_1 16 2 timer control register_2 tcr_2 8 h'ff30 tpu_2 8 2 timer mode register_2 tmdr_2 8 h'ff31 tpu_2 8 2 timer i/o control register_2 tior_2 8 h'ff32 tpu_2 8 2 timer interrupt enable register_2 tier_2 8 h'ff34 tpu_2 8 2 timer status register_2 tsr_2 8 h'ff35 tpu_2 8 2 timer counter_2 tcnt_2 16 h'ff36 tpu_2 16 2 timer general register a_2 tgra_2 16 h'ff38 tpu_2 16 2 timer general register b_2 tgrb_2 16 h'ff3a tpu_2 16 2 dma write enable register dmawer 8 h'ff60 dmac 8 2 dma terminal control register dmatcr 8 h'ff61 dmac 8 2 dma control register_0a dmacr_0 a 8 h'ff62 dmac 16 2 dma control register_0b dmacr_0 b 8 h'ff63 dmac 16 2 dma control register_1a dmacr_1 a 8 h'ff64 dmac 16 2 dma control register_1b dmacr_1 b 8 h'ff65 dmac 16 2 dma band control register h dmabcrh 8 h'ff66 dmac 16 2 dma band control register l dmabcrl 8 h'ff67 dmac 16 2 timer control register_0 tcr_0 8 h'ff68 tmr_0 8 2 timer control register_1 tcr_1 8 h'ff69 tmr_1 8 2
section 26 list of registers rev. 5.00 aug 08, 2006 page 815 of 982 rej09b0054-0500 register name abbrevia- tion bit no. address * 1 module data bus width access state timer control/status register_0 tcsr_0 8 h'ff6a tmr_0 8 2 timer control/status register_1 tcsr_1 8 h'ff6b tmr_1 8 2 time constant register a_0 tcora_0 8 h'ff6c tmr_0 8/16 2 time constant register a_1 tcora_1 8 h'ff6d tmr_1 8/16 2 time constant register b_0 tcorb_0 8 h'ff6e tmr_0 8/16 2 time constant register b_1 tcorb_1 8 h'ff6f tmr_1 8/16 2 timer counter_0 tcnt_0 8 h'ff70 tmr_0 8/16 2 timer counter_1 tcnt_1 8 h'ff71 tmr_1 8/16 2 timer control/status register_0 tcsr_0 8 h'ff74 wdt_0 16 2 timer counter_0 tcnt_0 8 h'ff74 (write) wdt_0 16 2 timer counter_0 tcnt_0 8 h'ff75 (read) wdt_0 16 2 reset control/status register rstcsr 8 h'ff76 (write) wdt_0 16 2 reset control/status register rstcsr 8 h'ff77 (read) wdt_0 16 2 serial mode register_0 smr_0 8 h'ff78 * 3 sci_0 8 2 i 2 c bus control register_0 iccr_0 8 h'ff78 * 3 iic_0 8 2 bit rate register_0 brr_0 8 h'ff79 * 3 sci_0 8 2 i 2 c bus status register_0 icsr_0 8 h'ff79 * 3 iic_0 8 2 serial control register_0 scr_0 8 h'ff7a sci_0 8 2 transmit data register_0 tdr_0 8 h'ff7b sci_0 8 2 serial status register_0 ssr_0 8 h'ff7c sci_0 8 2 receive data register_0 rdr_0 8 h'ff7d sci_0 8 2 smart card mode register_0 scmr_0 8 h'ff7e * 3 sci_0 8 2 i 2 c bus data register_0 icdr_0 8 h'ff7e * 3 iic_0 8 2 second slave address register_0 sarx_0 8 h'ff7e * 3 iic_0 8 2 i 2 c bus mode register_0 icmr_0 8 h'ff7f iic_0 8 2 slave address register_0 sar_0 8 h'ff7f iic_0 8 2 serial mode register_1 smr_1 8 h'ff80 * 3 sci_1 8 2 i 2 c bus control register_1 iccr_1 8 h'ff80 * 3 iic_1 8 2 bit rate register_1 brr_1 8 h'ff81 * 3 sci_1 8 2
section 26 list of registers rev. 5.00 aug 08, 2006 page 816 of 982 rej09b0054-0500 register name abbrevia- tion bit no. address * 1 module data bus width access state i 2 c bus status register_1 icsr_1 8 h'ff81 * 3 iic_1 8 2 serial control register_1 scr_1 8 h'ff82 sci_1 8 2 transmit data register_1 tdr_1 8 h'ff83 sci_1 8 2 serial status register_1 ssr_1 8 h'ff84 sci_1 8 2 receive data register_1 rdr_1 8 h'ff85 sci_1 8 2 smart card mode register_1 scmr_1 8 h'ff86 * 3 sci_1 8 2 i 2 c bus data register_1 icdr_1 8 h'ff86 * 3 iic_1 8 2 second slave address register_1 sarx_1 8 h'ff86 * 3 iic_1 8 2 i 2 c bus mode register_1 icmr_1 8 h'ff87 iic_1 8 2 slave address register_1 sar_1 8 h'ff87 iic_1 8 2 serial mode register_2 smr_2 8 h'ff88 sci_2 8 2 bit rate register_2 brr_2 8 h'ff89 sci_2 8 2 serial control register_2 scr_2 8 h'ff8a sci_2 8 2 transmit data register_2 tdr_2 8 h'ff8b sci_2 8 2 serial status register_2 ssr_2 8 h'ff8c sci_2 8 2 receive data register_2 rdr_2 8 h'ff8d sci_2 8 2 smart card mode register_2 scmr_2 8 h'ff8e sci_2 8 2 a/d data register ah addrah 8 h'ff90 a/d 8 2 a/d data register al addral 8 h'ff91 a/d 8 2 a/d data register bh addrbh 8 h'ff92 a/d 8 2 a/d data register bl addrbl 8 h'ff93 a/d 8 2 a/d data register ch addrch 8 h'ff94 a/d 8 2 a/d data register cl addrcl 8 h'ff95 a/d 8 2 a/d data register dh addrdh 8 h'ff96 a/d 8 2 a/d data register dl addrdl 8 h'ff97 a/d 8 2 a/d control/status register adcsr 8 h'ff98 a/d 8 2 a/d control register adcr 8 h'ff99 a/d 8 2 timer control/status register_1 tcsr_1 8 h'ffa2 wdt_1 16 2 timer counter_1 tcnt_1 8 h'ffa2 (write) wdt_1 16 2 timer counter_1 tcnt_1 8 h'ffa3 (read) wdt_1 16 2 flash memory control register 1 flmcr1 8 h'ffa8 flash 8 2
section 26 list of registers rev. 5.00 aug 08, 2006 page 817 of 982 rej09b0054-0500 register name abbrevia- tion bit no. address * 1 module data bus width access state flash memory control register 2 flmcr2 8 h'ffa9 flash 8 2 erase block register 1 ebr1 8 h'ffaa flash 8 2 erase block register 2 ebr2 8 h'ffab flash 8 2 flash memory power control register flpwcr 8 h'ffac flash 8 2 port 1 register port1 8 h'ffb0 port 8 2 port 3 register port3 8 h'ffb2 port 8 2 port 4 register port4 8 h'ffb3 port 8 2 port 7 register port7 8 h'ffb6 port 8 2 port 9 register port9 8 h'ffb8 port 8 2 port a register porta 8 h'ffb9 port 8 2 port b register portb 8 h'ffba port 8 2 port c register portc 8 h'ffbb port 8 2 port d register portd 8 h'ffbc port 8 2 port e register porte 8 h'ffbd port 8 2 port f register portf 8 h'ffbe port 8 2 port g register portg 8 h'ffbf port 8 2 notes: 1. lower 16 bits of the address. 2. allocated on the on-chip ram. 32-bit bus when dtc accesses as register information, and 16-bit in other cases. 3. part of registers sci_0 and sci_1 and part of registers iic_0 and iic_1 are allocated to the same address. use the iice bit of the serial control register x (scrx) to select the register.
section 26 list of registers rev. 5.00 aug 08, 2006 page 818 of 982 rej09b0054-0500 26.2 register bits register addresses and bit names of the on-chip peripheral modules are described below. each line covers eight bits, and 16-bit register is shown as 2 lines. register name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module mra sm1 sm0 dm1 dm0 md1 md0 dts sz dtc sar bit 23 bit 22 bit 21 bit 20 bit 19 bit 18 bit 17 bit 16 bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 mrb chne disel ?????? dar bit 23 bit 22 bit 21 bit 20 bit 19 bit 18 bit 17 bit 16 bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 cra bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 crb bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 iectr iee iol dee ck re luee ?? ieb iecmr ????? cmd2 cmd1 cmd0 iemcr ss rn2 rn1 rn0 ctl3 ctl2 ctl1 ctl0 iear1 iar3 iar2 iar1 iar0 imd1 imd0 ? ste iear2 iar11 iar10 iar9 iar8 iar7 iar6 iar5 iar4 iesa1 isa3 isa2 isa1 isa0 ???? iesa2 isa11 isa10 isa9 isa8 isa7 isa6 isa5 isa4 ietbfl tbfl7 tbfl6 tbfl5 tbfl4 tbfl3 tbfl2 tbfl1 tbfl0 ietbr tbr7 tbr6 tbr5 tbr4 tbr3 tbr2 tbr1 tbr0 iema1 ima3 ima2 ima1 ima0 ???? iema2 ima11 ima10 ima9 ima8 ima7 ima6 ima5 ima4 ierctl ???? rctl3 rctl2 rctl1 rctl0 ierbfl rbfl7 rbfl6 rbfl5 rbfl4 rbfl3 rbfl2 rbfl1 rbfl0 ierbr rbr7 rbr6 rbr5 rbr4 rbr3 rbr2 rbr1 rbr0 iela1 ila7 ila6 ila5 ila4 ila3 ila2 ila1 ila0
section 26 list of registers rev. 5.00 aug 08, 2006 page 819 of 982 rej09b0054-0500 register name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module iela2 ???? ila11 ila10 ila9 ila8 ieb ieflg cmx mrq srq sre lck ? rss gg ietsr txrdy ??? ira txs txf txe ieiet txrdye ??? irae txse txfe txee ietef ??? al ue ttme ro ack iersr rxrdy ???? rxs rxf rxe ieier rxrdye ???? rxse rxfe rxee ieref ???? ove rtme dle pe dadr_0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 d/a converter dadr_1 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 dacr daoe1 daoe0 dae ????? scrx ? iicx1 iicx0 iice flshe ??? iic, flash ddcswr ???? clr3 clr2 clr1 clr0 iic tcr_2 cmieb cmiea ovie cclr1 cclr0 cks2 cks1 cks0 tmr_2 tcr_3 cmieb cmiea ovie cclr1 cclr0 cks2 cks1 cks0 tmr_3 tcsr_2 cmfb cmfa ovf ? os3 os2 os1 os0 tmr_2 tcsr_3 cmfb cmfa ovf ? os3 os2 os1 os0 tmr_3 tcora_2 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tmr_2 tcora_3 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tmr_3 tcorb_2 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tmr_2 tcorb_3 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tmr_3 tcnt_2 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tmr_2 tcnt_3 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tmr_3 smr_3 * 1 c/ a chr pe o/ e stop mp cks1 cks0 sci_3 (gm) (blk) (pe) (o/ e) (bcp1) (bcp0) (cks1) (cks0) brr_3 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 scr_3 tie rie te re mpie teie cke1 cke0 tdr_3 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ssr_3 * 1 tdre rdrf orer fer per tend mpb mpbt (tdre) (rdrf) (orer) (ers) (per) (tend) (mpb) (mpbt) rdr_3 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 scmr_3 ???? sdir sinv ? smif
section 26 list of registers rev. 5.00 aug 08, 2006 page 820 of 982 rej09b0054-0500 register name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module sbycr ssby sts2 sts1 sts0 ope ??? system syscr ?? intm1 intm0 nmieg mrese ? rame sckcr pstop ???? sck2 sck1 sck0 mdcr ????? mds2 mds1 mds0 mstpcra mstpa7 mstpa6 mstpa5 mstpa4 mstpa3 mstpa2 mstpa1 mstpa0 mstpcrb mstpb7 mstpb6 mstpb5 mstpb4 mstpb3 mstpb2 mstpb1 mstpb0 mstpcrc mstpc7 mstpc6 mstpc5 mstpc4 mstpc3 mstpc2 mstpc1 mstpc0 pfcr ?? buzze ? ae3 ae2 ae1 ae0 bsc lpwrcr dton lson nesel substp rfcut ? stc1 stc0 system semr_0 sse ??? abcs acs2 acs1 acs0 sci_0 bara ???????? pbc baa23 baa22 baa21 baa20 baa19 baa18 baa17 baa16 baa15 baa14 baa13 baa12 baa11 baa10 baa9 baa8 baa7 baa6 baa5 baa4 baa3 baa2 baa1 baa0 barb ???????? bab23 bab22 bab21 bab20 bab19 bab18 bab17 bab16 bab15 bab14 bab13 bab12 bab11 bab10 bab9 bab8 bab7 bab6 bab5 bab4 bab3 bab2 bab1 bab0 bcra cmfa cda bamra2 bamra1 bamra0 csela1 csela0 biea bcrb cmfb cdb bamrb2 bamrb1 bamrb0 cselb1 cselb0 bieb iscrh irq7scb irq7sca irq6scb irq6sca irq5scb irq5sca irq4scb irq4sca int iscrl irq3scb irq3sca irq2scb irq2sca irq1scb irq1sca irq0scb irq0sca ier irq7e irq6e irq5e irq4e irq3e irq2e irq1e irq0e isr irq7f irq6f irq5f irq4f irq3f irq2f irq1f irq0f dtcera dtcea7 dtcea6 dtcea5 dtcea4 dtcea3 dtcea2 dtcea1 dtcea0 dtc dtcerb ? dtceb6 dtceb5 dtceb4 dtceb3 dtceb2 dtceb1 dtceb0 dtcerc dtcec7 dtcec6 dtcec5 dtcec4 dtcec3 dtcec2 dtcec1 dtcec0 dtcerd ?? dtced5 dtced4 dtced3 dtced2 dtced1 dtced0 dtcere dtcee7 dtcee6 dtcee5 dtcee4 dtcee3 dtcee2 dtcee1 dtcee0 dtcerf dtcef7 dtcef6 dtcef5 dtcef4 dtcef3 dtcef2 dtcef1 dtcef0 dtceri dtcei7 dtcei6 ?????? dtvecr swdte dtvec6 dtvec5 dtvec4 dtvec3 dtvec2 dtvec1 dtvec0
section 26 list of registers rev. 5.00 aug 08, 2006 page 821 of 982 rej09b0054-0500 register name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module p1ddr p17ddr p16ddr p15ddr p14ddr p13ddr p12ddr p11ddr p10ddr port p3ddr ? p36ddr p35ddr p34ddr p33ddr p32ddr p31ddr p30ddr p7ddr p77ddr p76ddr p75ddr p74ddr p73ddr p72ddr p71ddr p70ddr paddr ???? pa3ddr pa2ddr pa1ddr pa0ddr pbddr pb7ddr pb6ddr pb5ddr pb4ddr pb3ddr pb2ddr pb1ddr pb0ddr pcddr pc7ddr pc6ddr pc5ddr pc4ddr pc3ddr pc2ddr pc1ddr pc0ddr pdddr pd7ddr pd6ddr pd5ddr pd4ddr pd3ddr pd2ddr pd1ddr pd0ddr peddr pe7ddr pe6ddr pe5ddr pe4ddr pe3ddr pe2ddr pe1ddr pe0ddr pfddr pf7ddr pf6ddr pf5ddr pf4ddr pf3ddr pf2ddr pf1ddr pf0ddr pgddr ??? pg4ddr pg3ddr pg2ddr pg1ddr pg0ddr papcr ???? pa3pcr pa2pcr pa1pcr pa0pcr pbpcr pb7pcr pb6pcr pb5pcr pb4pcr pb3pcr pb2pcr pb1pcr pb0pcr pcpcr pc7pcr pc6pcr pc5pcr pc4pcr pc3pcr pc2pcr pc1pcr pc0pcr pdpcr pd7pcr pd6pcr pd5pcr pd4pcr pd3pcr pd2pcr pd1pcr pd0pcr pepcr pe7pcr pe6pcr pe5pcr pe4pcr pe3pcr pe2pcr pe1pcr pe0pcr p3odr ? p36odr p35odr p34odr p33odr p32odr p31odr p30odr paodr ???? pa3odr pa2odr pa1odr pa0odr tcr_3 cclr2 cclr1 cclr0 ckeg1 ckeg0 tpsc2 tpsc1 tpsc0 tpu_3 tmdr_3 ?? bfb bfa md3 md2 md1 md0 tiorh_3 iob3 iob2 iob1 iob0 ioa3 ioa2 ioa1 ioa0 tiorl_3 iod3 iod2 iod1 iod0 ioc3 ioc2 ioc1 ioc0 tier_3 ttge ?? tciev tgied tgiec tgieb tgiea tsr_3 ??? tcfv tgfd tgfc tgfb tgfa tcnt_3 bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tgra_3 bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tgrb_3 bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tgrc_3 bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
section 26 list of registers rev. 5.00 aug 08, 2006 page 822 of 982 rej09b0054-0500 register name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module tgrd_3 bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 tpu_3 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tcr_4 ? cclr1 cclr0 ckeg1 ckeg0 tpsc2 tpsc1 tpsc0 tpu_4 tmdr_4 ???? md3 md2 md1 md0 tior_4 iob3 iob2 iob1 iob0 ioa3 ioa2 ioa1 ioa0 tier_4 ttge ? tcieu tciev ?? tgieb tgiea tsr_4 tcfd ? tcfu tcfv ?? tgfb tgfa tcnt_4 bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tgra_4 bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tgrb_4 bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tcr_5 ? cclr1 cclr0 ckeg1 ckeg0 tpsc2 tpsc1 tpsc0 tpu_5 tmdr_5 ???? md3 md2 md1 md0 tior_5 iob3 iob2 iob1 iob0 ioa3 ioa2 ioa1 ioa0 tier_5 ttge ? tcieu tciev ?? tgieb tgiea tsr_5 tcfd ? tcfu tcfv ?? tgfb tgfa tcnt_5 bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tgra_5 bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tgrb_5 bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tstr ?? cst5 cst4 cst3 cst2 cst1 cst0 tpu tsyr ?? sync5 sync4 sync3 sync2 sync1 sync0 ipra ? ipr6 ipr5 ipr4 ? ipr2 ipr1 ipr0 int iprb ? ipr6 ipr5 ipr4 ? ipr2 ipr1 ipr0 iprc ? ipr6 ipr5 ipr4 ? ipr2 ipr1 ipr0 iprd ? ipr6 ipr5 ipr4 ? ipr2 ipr1 ipr0 ipre ? ipr6 ipr5 ipr4 ? ipr2 ipr1 ipr0
section 26 list of registers rev. 5.00 aug 08, 2006 page 823 of 982 rej09b0054-0500 register name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module iprf ? ipr6 ipr5 ipr4 ? ipr2 ipr1 ipr0 int iprg ? ipr6 ipr5 ipr4 ? ipr2 ipr1 ipr0 iprh ? ipr6 ipr5 ipr4 ? ipr2 ipr1 ipr0 ipri ? ipr6 ipr5 ipr4 ? ipr2 ipr1 ipr0 iprj ? ipr6 ipr5 ipr4 ? ipr2 ipr1 ipr0 iprk ? ipr6 ipr5 ipr4 ? ipr2 ipr1 ipr0 iprl ? ipr6 ipr5 ipr4 ? ipr2 ipr1 ipr0 ipro ? ipr6 ipr5 ipr4 ? ipr2 ipr1 ipr0 abwcr abw7 abw6 abw5 abw4 abw3 abw2 abw1 abw0 bsc astcr ast7 ast6 ast5 ast4 ast3 ast2 ast1 ast0 wcrh w71 w70 w61 w60 w51 w50 w41 w40 wcrl w31 w30 w21 w20 w11 w10 w01 w00 bcrh icis1 icis0 brstrm brsts1 brsts0 ??? bcrl brle ?????? waite ramer ???? rams ram2 ram1 ram0 flash mar_0a ???????? dmac bit 23 bit 22 bit 21 bit 20 bit 19 bit 18 bit 17 bit 16 bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ioar_0a bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 etcr_0a bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 mar_0b ???????? bit 23 bit 22 bit 21 bit 20 bit 19 bit 18 bit 17 bit 16 bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ioar_0b bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 etcr_0b bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
section 26 list of registers rev. 5.00 aug 08, 2006 page 824 of 982 rej09b0054-0500 register name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module mar_1a ???????? dmac bit 23 bit 22 bit 21 bit 20 bit 19 bit 18 bit 17 bit 16 bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ioar_1a bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 etcr_1a bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 mar_1b ???????? bit 23 bit 22 bit 21 bit 20 bit 19 bit 18 bit 17 bit 16 bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ioar_1b bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 etcr_1b bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 p1dr p17dr p16dr p15dr p14dr p13dr p12dr p11dr p10dr port p3dr ? p36dr p35dr p34dr p33dr p32dr p31dr p30dr p7dr p77dr p76dr p75dr p74dr p73dr p72dr p71dr p70dr padr ???? pa3dr pa2dr pa1dr pa0dr pbdr pb7dr pb6dr pb5dr pb4dr pb3dr pb2dr pb1dr pb0dr pcdr pc7dr pc6dr pc5dr pc4dr pc3dr pc2dr pc1dr pc0dr pddr pd7dr pd6dr pd5dr pd4dr pd3dr pd2dr pd1dr pd0dr pedr pe7dr pe6dr pe5dr pe4dr pe3dr pe2dr pe1dr pe0dr pfdr pf7dr pf6dr pf5dr pf4dr pf3dr pf2dr pf1dr pf0dr pgdr ??? pg4dr pg3dr pg2dr pg1dr pg0dr tcr_0 cclr2 cclr1 cclr0 ckeg1 ckeg0 tpsc2 tpsc1 tpsc0 tpu_0 tmdr_0 ?? bfb bfa md3 md2 md1 md0 tiorh_0 iob3 iob2 iob1 iob0 ioa3 ioa2 ioa1 ioa0 tiorl_0 iod3 iod2 iod1 iod0 ioc3 ioc2 ioc1 ioc0 tier_0 ttge ?? tciev tgied tgiec tgieb tgiea
section 26 list of registers rev. 5.00 aug 08, 2006 page 825 of 982 rej09b0054-0500 register name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module tsr_0 ??? tcfv tgfd tgfc tgfb tgfa tpu_0 tcnt_0 bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tgra_0 bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tgrb_0 bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tgrc_0 bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tgrd_0 bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tcr_1 ? cclr1 cclr0 ckeg1 ckeg0 tpsc2 tpsc1 tpsc0 tpu_1 tmdr_1 ???? md3 md2 md1 md0 tior_1 iob3 iob2 iob1 iob0 ioa3 ioa2 ioa1 ioa0 tier_1 ttge ? tcieu tciev ?? tgieb tgiea tsr_1 tcfd ? tcfu tcfv ?? tgfb tgfa tcnt_1 bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tgra_1 bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tgrb_1 bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tcr_2 ? cclr1 cclr0 ckeg1 ckeg0 tpsc2 tpsc1 tpsc0 tpu_2 tmdr_2 ???? md3 md2 md1 md0 tior_2 iob3 iob2 iob1 iob0 ioa3 ioa2 ioa1 ioa0 tier_2 ttge ? tcieu tciev ?? tgieb tgiea tsr_2 tcfd ? tcfu tcfv ?? tgfb tgfa tcnt_2 bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tgra_2 bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
section 26 list of registers rev. 5.00 aug 08, 2006 page 826 of 982 rej09b0054-0500 register name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module tgrb_2 bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 tpu_2 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 dmawer ???? we1b we1a we0b we0a dmac dmatcr ?? tee1 tee0 ???? dmacr_0a * 2 dtsz dtid rpe dtdir dtf3 dtf2 dtf1 dtf0 dmacr_0a * 3 dtsz said saide blkdir blke ??? dmacr_0b * 2 dtsz dtid rpe dtdir dtf3 dtf2 dtf1 dtf0 dmacr_0b * 3 ? daid daide ? dtf3 dtf2 dtf1 dtf0 dmacr_1a * 2 dtsz dtid rpe dtdir dtf3 dtf2 dtf1 dtf0 dmacr_1a * 3 dtsz said saide blkdir blke ??? dmacr_1b * 2 dtsz dtid rpe dtdir dtf3 dtf2 dtf1 dtf0 dmacr_1b * 3 ? daid daide ? dtf3 dtf2 dtf1 dtf0 dmabcrh * 2 fae1 fae0 sae1 sae0 dta1b dta1a dta0b dta0a dmabcrh * 3 fae1 fae0 ?? dta1 ? dta0 ? dmabcrl * 2 dte1b dte1a dte0b dte0a dtie1b dtie1a dtie0b dtie0a dmabcrl * 3 dtme1 dte1 dtme0 dte0 dtie1b dtie1a dtie0b dtie0a tcr_0 cmieb cmiea ovie cclr1 cclr0 cks2 cks1 cks0 tmr_0 tcr_1 cmieb cmiea ovie cclr1 cclr0 cks2 cks1 cks0 tmr_1 tcsr_0 cmfb cmfa ovf adte os3 os2 os1 os0 tmr_0 tcsr_1 cmfb cmfa ovf ? os3 os2 os1 os0 tmr_1 tcora_0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tmr_0 tcora_1 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tmr_1 tcorb_0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tmr_0 tcorb_1 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tmr_1 tcnt_0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tmr_0 tcnt_1 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tmr_1 tcsr_0 ovf wt/ it tme ?? cks2 cks1 cks0 wdt_0 tcnt_0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 rstcsr wovf rste rsts ????? smr_0 * 1 c/ a (gm) chr (blk) pe (pe) o/ e (o/ e ) stop (bcp1) mp (bcp0) cks1 (cks1) cks0 (cks0) sci_0
section 26 list of registers rev. 5.00 aug 08, 2006 page 827 of 982 rej09b0054-0500 register name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module iccr_0 ice ieic mst trs acke bbsy iric scp iic_0 brr_0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 sci_0 icsr_0 estp stop irtr aasx al aas adz ackb iic_0 scr_0 tie rie te re mpie teie cke1 cke0 sci_0 tdr_0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ssr_0 * 1 tdre (tdre) rdrf (rdrf) orer (orer) fer (ers) per (per) tend (tend) mpb (mpb) mpbt (mpbt) rdr_0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 scmr_0 ???? sdir sinv ? smif icdr_0 icdr7 icdr6 icdr5 icdr4 icdr3 icdr2 icdr1 icdr0 iic_0 sarx_0 svax6 svax5 svax4 svax3 svax2 svax1 svax0 fsx icmr_0 mls wait cks2 cks1 cks0 bc2 bc1 bc0 sar_0 sva6 sva5 sva4 sva3 sva2 sva1 sva0 fs smr_1 * 1 c/ a (gm) chr (blk) pe (pe) o/ e (o/ e ) stop (bcp1) mp (bcp0) cks1 (cks1) cks0 (cks0) sci_1 iccr_1 ice ieic mst trs acke bbsy iric scp iic_1 brr_1 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 sci_1 icsr_1 estp stop irtr aasx al aas adz ackb iic_1 scr_1 tie rie te re mpie teie cke1 cke0 sci_1 tdr_1 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ssr_1 * 1 tdre (tdre) rdrf (rdrf) orer (orer) fer (ers) per (per) tend (tend) mpb (mpb) mpbt (mpbt) rdr_1 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 scmr_1 ???? sdir sinv ? smif icdr_1 icdr7 icdr6 icdr5 icdr4 icdr3 icdr2 icdr1 icdr0 iic_1 sarx_1 svax6 svax5 svax4 svax3 svax2 svax1 svax0 fsx icmr_1 mls wait cks2 cks1 cks0 bc2 bc1 bc0 sar_1 sva6 sva5 sva4 sva3 sva2 sva1 sva0 fs smr_2 * 1 c/ a (gm) chr (blk) pe (pe) o/ e (o/ e ) stop (bcp1) mp (bcp0) cks1 (cks1) cks0 (cks0) sci_2 brr_2 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 scr_2 tie rie te re mpie teie cke1 cke0
section 26 list of registers rev. 5.00 aug 08, 2006 page 828 of 982 rej09b0054-0500 register name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module tdr_2 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 sci_2 ssr_2 * 1 tdre (tdre) rdrf (rdrf) orer (orer) fer (ers) per (per) tend (tend) mpb (mpb) mpbt (mpbt) rdr_2 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 scmr_2 ???? sdir sinv ? smif addrah ad9 ad8 ad7 ad6 ad5 ad4 ad3 ad2 a/d converter addral ad1 ad0 ?????? addrbh ad9 ad8 ad7 ad6 ad5 ad4 ad3 ad2 addrbl ad1 ad0 ?????? addrch ad9 ad8 ad7 ad6 ad5 ad4 ad3 ad2 addrcl ad1 ad0 ?????? addrdh ad9 ad8 ad7 ad6 ad5 ad4 ad3 ad2 addrdl ad1 ad0 ?????? adcsr adf adie adst scan ? ch2 ch1 ch0 adcr trgs1 trgs0 ?? cks1 cks0 ?? tcsr_1 ovf wt/ it tme pss rst/ nmi cks2 cks1 cks0 wdt_1 tcnt_1 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 flmcr1 fwe swe1 esu1 psu1 ev1 pv1 e1 p1 flash flmcr2 fler ??????? ebr1 eb7 eb6 eb5 eb4 eb3 eb2 eb1 eb0 ebr2 ?? eb13 eb12 eb11 eb10 eb9 eb8 flpwcr pdwnd ??????? port1 p17 p16 p15 p14 p13 p12 p11 p10 port port3 ? p36 p35 p34 p33 p32 p31 p30 port4 p47 p46 p45 p44 p43 p42 p41 p40 port7 p77 p76 p75 p74 p73 p72 p71 p70 port9 p97 p96 ?????? porta ???? pa3 pa2 pa1 pa0 portb pb7 pb6 pb5 pb4 pb3 pb2 pb1 pb0 portc pc7 pc6 pc5 pc4 pc3 pc2 pc1 pc0 portd pd7 pd6 pd5 pd4 pd3 pd2 pd1 pd0
section 26 list of registers rev. 5.00 aug 08, 2006 page 829 of 982 rej09b0054-0500 register name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module porte pe7 pe6 pe5 pe4 pe3 pe2 pe1 pe0 port portf pf7 pf6 pf5 pf4 pf3 pf2 pf1 pf0 portg ??? pg4 pg3 pg2 pg1 pg0 notes: 1. some bit names differ depending on whether used in normal mode and smart card interface mode. the name in ( ) indicates the name in smart card interface mode. 2. short address mode 3. full address mode
section 26 list of registers rev. 5.00 aug 08, 2006 page 830 of 982 rej09b0054-0500 26.3 register states in each operating mode register name reset manual reset high- speed medium- speed sleep module stop watch sub- active sub- sleep software standby hardware standby module mra initialized initialized ???????? initialized dtc sar initialized initialized ???????? initialized mrb initialized initialized ???????? initialized dar initialized initialized ???????? initialized cra initialized initialized ???????? initialized crb initialized initialized ???????? initialized iectr initialized initialized ???????? initialized ieb iecmr initialized initialized ???????? initialized iemcr initialized initialized ???????? initialized iear1 initialized initialized ???????? initialized iear2 initialized initialized ???????? initialized iesa1 initialized initialized ???????? initialized iesa2 initialized initialized ???????? initialized ietbfl initialized initialized ???????? initialized ietbr initialized initialized ???????? initialized iema1 initialized initialized ???????? initialized iema2 initialized initialized ???????? initialized ierctl initialized initialized ???????? initialized ierbfl initialized initialized ???????? initialized ierbr initialized initialized ???????? initialized iela1 initialized initialized ???????? initialized iela2 initialized initialized ???????? initialized ieflg initialized initialized ???????? initialized ietsr initialized initialized ???????? initialized ieiet initialized initialized ???????? initialized ietef initialized initialized ???????? initialized iersr initialized initialized ???????? initialized ieier initialized initialized ???????? initialized ieref initialized initialized ???????? initialized
section 26 list of registers rev. 5.00 aug 08, 2006 page 831 of 982 rej09b0054-0500 register name reset manual reset high- speed medium- speed sleep module stop watch sub- active sub- sleep software standby hardware standby module dadr_0 initialized initialized ???????? initialized d/a dadr_1 initialized initialized ???????? initialized dacr initialized initialized ???????? initialized scrx initialized initialized ???????? initialized iic ddcswr initialized initialized ???????? initialized tcr_2 initialized initialized ???????? initialized tmr_2 tcr_3 initialized initialized ???????? initialized tmr_3 tcsr_2 initialized initialized ???????? initialized tmr_2 tcsr_3 initialized initialized ???????? initialized tmr_3 tcora_2 initialized initialized ???????? initialized tmr_2 tcora_3 initialized initialized ???????? initialized tmr_3 tcorb_2 initialized initialized ???????? initialized tmr_2 tcorb_3 initialized initialized ???????? initialized tmr_3 tcnt_2 initialized initialized ???????? initialized tmr_2 tcnt_3 initialized initialized ???????? initialized tmr_3 smr_3 initialized initialized ???????? initialized sci_3 brr_3 initialized initialized ???????? initialized scr_3 initialized initialized ???????? initialized tdr_3 initialized initialized ??? initialized initialized initialized initialized initialized initialized ssr_3 initialized initialized ??? initialized initialized initialized initialized initialized initialized rdr_3 initialized initialized ??? initialized initialized initialized initialized initialized initialized scmr_3 initialized initialized ???????? initialized sbycr initialized initialized ???????? initialized system syscr initialized ????????? initialized sckcr initialized initialized ???????? initialized mdcr initialized ????????? initialized mstpcra initialized initialized ???????? initialized mstpcrb initialized initialized ???????? initialized mstpcrc initialized initialized ???????? initialized pfcr initialized ????????? initialized bsc lpwrcr initialized ????????? initialized system semr_0 initialized initialized ???????? initialized sci_0
section 26 list of registers rev. 5.00 aug 08, 2006 page 832 of 982 rej09b0054-0500 register name reset manual reset high- speed medium- speed sleep module stop watch sub- active sub- sleep software standby hardware standby module bara initialized initialized ???????? initialized pbc barb initialized initialized ???????? initialized bcra initialized initialized ???????? initialized bcrb initialized initialized ???????? initialized iscrh initialized initialized ???????? initialized int iscrl initialized initialized ???????? initialized ier initialized initialized ???????? initialized isr initialized initialized ???????? initialized dtcera initialized initialized ???????? initialized dtc dtcerb initialized initialized ???????? initialized dtcerc initialized initialized ???????? initialized dtcerd initialized initialized ???????? initialized dtcere initialized initialized ???????? initialized dtcerf initialized initialized ???????? initialized dtceri initialized initialized ???????? initialized dtvecr initialized initialized ???????? initialized p1ddr initialized ????????? initialized port p3ddr initialized ????????? initialized p7ddr initialized ????????? initialized paddr initialized ????????? initialized pbddr initialized ????????? initialized pcddr initialized ????????? initialized pdddr initialized ????????? initialized peddr initialized ????????? initialized pfddr initialized ????????? initialized pgddr initialized ????????? initialized papcr initialized ????????? initialized pbpcr initialized ????????? initialized pcpcr initialized ????????? initialized pdpcr initialized ????????? initialized pepcr initialized ????????? initialized p3odr initialized ????????? initialized
section 26 list of registers rev. 5.00 aug 08, 2006 page 833 of 982 rej09b0054-0500 register name reset manual reset high- speed medium- speed sleep module stop watch sub- active sub- sleep software standby hardware standby module paodr initialized ????????? initialized port tcr_3 initialized initialized ???????? initialized tpu_3 tmdr_3 initialized initialized ???????? initialized tiorh_3 initialized initialized ???????? initialized tiorl_3 initialized initialized ???????? initialized tier_3 initialized initialized ???????? initialized tsr_3 initialized initialized ???????? initialized tcnt_3 initialized initialized ???????? initialized tgra_3 initialized initialized ???????? initialized tgrb_3 initialized initialized ???????? initialized tgrc_3 initialized initialized ???????? initialized tgrd_3 initialized initialized ???????? initialized tcr_4 initialized initialized ???????? initialized tpu_4 tmdr_4 initialized initialized ???????? initialized tior_4 initialized initialized ???????? initialized tier_4 initialized initialized ???????? initialized tsr_4 initialized initialized ???????? initialized tcnt_4 initialized initialized ???????? initialized tgra_4 initialized initialized ???????? initialized tgrb_4 initialized initialized ???????? initialized tcr_5 initialized initialized ???????? initialized tpu_5 tmdr_5 initialized initialized ???????? initialized tior_5 initialized initialized ???????? initialized tier_5 initialized initialized ???????? initialized tsr_5 initialized initialized ???????? initialized tcnt_5 initialized initialized ???????? initialized tgra_5 initialized initialized ???????? initialized tgrb_5 initialized initialized ???????? initialized tstr initialized initialized ???????? initialized tpu tsyr initialized initialized ???????? initialized
section 26 list of registers rev. 5.00 aug 08, 2006 page 834 of 982 rej09b0054-0500 register name reset manual reset high- speed medium- speed sleep module stop watch sub- active sub- sleep software standby hardware standby module ipra initialized initialized ???????? initialized int iprb initialized initialized ???????? initialized iprc initialized initialized ???????? initialized iprd initialized initialized ???????? initialized ipre initialized initialized ???????? initialized iprf initialized initialized ???????? initialized iprg initialized initialized ???????? initialized iprh initialized initialized ???????? initialized ipri initialized initialized ???????? initialized iprj initialized initialized ???????? initialized iprk initialized initialized ???????? initialized iprl initialized initialized ???????? initialized ipro initialized initialized ???????? initialized abwcr initialized ????????? initialized bsc astcr initialized ????????? initialized wcrh initialized ????????? initialized wcrl initialized ????????? initialized bcrh initialized ????????? initialized bcrl initialized ????????? initialized ramer initialized ????????? initialized flash mar_0a ??????????? dmac ioar_0a ??????????? etcr_0a ??????????? mar_0b ??????????? ioar_0b ??????????? etcr_0b ??????????? mar_1a ??????????? ioar_1a ??????????? etcr_1a ??????????? mar_1b ??????????? ioar_1b ??????????? etcr_1b ???????????
section 26 list of registers rev. 5.00 aug 08, 2006 page 835 of 982 rej09b0054-0500 register name reset manual reset high- speed medium- speed sleep module stop watch sub- active sub- sleep software standby hardware standby module p1dr initialized ????????? initialized port p3dr initialized ????????? initialized p7dr initialized ????????? initialized padr initialized ????????? initialized pbdr initialized ????????? initialized pcdr initialized ????????? initialized pddr initialized ????????? initialized pedr initialized ????????? initialized pfdr initialized ????????? initialized pgdr initialized ????????? initialized tcr_0 initialized initialized ???????? initialized tpu_0 tmdr_0 initialized initialized ???????? initialized tiorh_0 initialized initialized ???????? initialized tiorl_0 initialized initialized ???????? initialized tier_0 initialized initialized ???????? initialized tsr_0 initialized initialized ???????? initialized tcnt_0 initialized initialized ???????? initialized tgra_0 initialized initialized ???????? initialized tgrb_0 initialized initialized ???????? initialized tgrc_0 initialized initialized ???????? initialized tgrd_0 initialized initialized ???????? initialized tcr_1 initialized initialized ???????? initialized tpu_1 tmdr_1 initialized initialized ???????? initialized tior_1 initialized initialized ???????? initialized tier_1 initialized initialized ???????? initialized tsr_1 initialized initialized ???????? initialized tcnt_1 initialized initialized ???????? initialized tgra_1 initialized initialized ???????? initialized tgrb_1 initialized initialized ???????? initialized
section 26 list of registers rev. 5.00 aug 08, 2006 page 836 of 982 rej09b0054-0500 register name reset manual reset high- speed medium- speed sleep module stop watch sub- active sub- sleep software standby hardware standby module tcr_2 initialized initialized ???????? initialized tpu_2 tmdr_2 initialized initialized ???????? initialized tior_2 initialized initialized ???????? initialized tier_2 initialized initialized ???????? initialized tsr_2 initialized initialized ???????? initialized tcnt_2 initialized initialized ???????? initialized tgra_2 initialized initialized ???????? initialized tgrb_2 initialized initialized ???????? initialized dmawer initialized initialized ???????? initialized dmac dmatcr initialized initialized ???????? initialized dmacr_0a initialized initialized ???????? initialized dmacr_0b initialized initialized ???????? initialized dmacr_1a initialized initialized ???????? initialized dmacr_1b initialized initialized ???????? initialized dmabcrh initialized initialized ???????? initialized dmabcrl initialized initialized ???????? initialized tcr_0 initialized initialized ???????? initialized tmr_0 tcr_1 initialized initialized ???????? initialized tmr_1 tcsr_0 initialized initialized ???????? initialized tmr_0 tcsr_1 initialized initialized ???????? initialized tmr_1 tcora_0 initialized initialized ???????? initialized tmr_0 tcora_1 initialized initialized ???????? initialized tmr_1 tcorb_0 initialized initialized ???????? initialized tmr_0 tcorb_1 initialized initialized ???????? initialized tmr_1 tcnt_0 initialized initialized ???????? initialized tmr_0 tcnt_1 initialized initialized ???????? initialized tmr_1 tcsr_0 initialized initialized ???????? initialized wdt_0 tcnt_0 initialized initialized ???????? initialized rstcsr initialized initialized ???????? initialized smr_0 initialized initialized ???????? initialized sci_0 iccr_0 initialized initialized ???????? initialized iic_0
section 26 list of registers rev. 5.00 aug 08, 2006 page 837 of 982 rej09b0054-0500 register name reset manual reset high- speed medium- speed sleep module stop watch sub- active sub- sleep software standby hardware standby module brr_0 initialized initialized ???????? initialized sci_0 icsr_0 initialized initialized ???????? initialized iic_0 scr_0 initialized initialized ???????? initialized sci_0 tdr_0 initialized initialized ??? initialized initialized initialized initialized initialized initialized ssr_0 initialized initialized ??? initialized initialized initialized initialized initialized initialized rdr_0 initialized initialized ??? initialized initialized initialized initialized initialized initialized scmr_0 initialized initialized ???????? initialized icdr_0 initialized initialized ???????? initialized iic_0 sarx_0 initialized initialized ???????? initialized icmr_0 initialized initialized ???????? initialized sar_0 initialized initialized ???????? initialized smr_1 initialized initialized ???????? initialized sci_1 iccr_1 initialized initialized ???????? initialized iic_1 brr_1 initialized initialized ???????? initialized sci_1 icsr_1 initialized initialized ???????? initialized iic_1 scr_1 initialized initialized ???????? initialized sci_1 tdr_1 initialized initialized ??? initialized initialized initialized initialized initialized initialized ssr_1 initialized initialized ??? initialized initialized initialized initialized initialized initialized rdr_1 initialized initialized ??? initialized initialized initialized initialized initialized initialized scmr_1 initialized initialized ???????? initialized icdr_1 initialized initialized ???????? initialized iic_1 sarx_1 initialized initialized ???????? initialized icmr_1 initialized initialized ???????? initialized sar_1 initialized initialized ???????? initialized smr_2 initialized initialized ???????? initialized sci_2 brr_2 initialized initialized ???????? initialized scr_2 initialized initialized ???????? initialized tdr_2 initialized initialized ??? initialized initialized initialized initialized initialized initialized ssr_2 initialized initialized ??? initialized initialized initialized initialized initialized initialized rdr_2 initialized initialized ??? initialized initialized initialized initialized initialized initialized scmr_2 initialized ????????? initialized
section 26 list of registers rev. 5.00 aug 08, 2006 page 838 of 982 rej09b0054-0500 register name reset manual reset high- speed medium- speed sleep module stop watch sub- active sub- sleep software standby hardware standby module addrah initialized initialized ??? initialized initialized initialized initialized initialized initialized a/d addral initialized initialized ??? initialized initialized initialized initialized initialized initialized addrbh initialized initialized ??? initialized initialized initialized initialized initialized initialized addrbl initialized initialized ??? initialized initialized initialized initialized initialized initialized addrch initialized initialized ??? initialized initialized initialized initialized initialized initialized addrcl initialized initialized ??? initialized initialized initialized initialized initialized initialized addrdh initialized initialized ??? initialized initialized initialized initialized initialized initialized addrdl initialized initialized ??? initialized initialized initialized initialized initialized initialized adcsr initialized initialized ??? initialized initialized initialized initialized initialized initialized adcr initialized initialized ??? initialized initialized initialized initialized initialized initialized tcsr_1 initialized initialized ???????? initialized wdt_1 tcnt_1 initialized initialized ???????? initialized flmcr1 initialized ???????? initialized initialized flash flmcr2 initialized ???????? initialized initialized ebr1 initialized ???????? initialized initialized ebr2 initialized ???????? initialized initialized flpwcr initialized ???????? initialized initialized port1 initialized ????????? initialized port port3 initialized ????????? initialized port4 initialized ????????? initialized port7 initialized ????????? initialized port9 initialized ????????? initialized porta initialized ????????? initialized portb initialized ????????? initialized portc initialized ????????? initialized portd initialized ????????? initialized porte initialized ????????? initialized portf initialized ????????? initialized portg initialized ????????? initialized note: ? is not initialized.
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 839 of 982 rej09b0054-0500 section 27 electrical characteristics 27.1 power supply voltage and operating frequency range figures 27.1, 27.2, 27.3, 27.4, and 27.5 show power supply voltage and operating frequency ranges (shaded areas) of the h8s/2258 group, h8s/2239 group, h8s/2238b, h8s/2236b, h8s/2238r, h8s/2236r, and h8s/2237 group and h8s/2227 group respectively. (2) power supply voltage and instruction executing range active (high-speed/medium-speed) mode t (ns) 74 100 0 4.0 5.5 vcc (v) subactive mode t ( s) 30.5 0 4.0 5.5 (1) power supply voltage and oscillation frequency range active (high-speed/medium-speed) mode sleep mode f (mhz) 13.5 10.0 0 4.0 5.5 vcc (v) all operating modes f (khz) 32.768 0 4.0 5.5 note: when using the iebus, the system clock must be set to either 12 mhz or 12.58 mhz. when the iebus is not used, the system clock can be set to an arbitrary frequency between 10 mhz to 13.5 mhz. vcc (v) vcc (v) figure 27.1 power supply voltage and operating ranges (h8s/2258 group)
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 840 of 982 rej09b0054-0500 system clock (2) power supply voltage/analog power supply voltage and oscilllation frequency range (masked rom version) (1) power supply voltage/analog power supply voltage and oscilllation frequency range (f-ztat version) (4) power supply voltage and instruction executing range (masked rom version) (3) power supply voltage and instruction executing range (f-ztat version) active (high/medium speed) mode sleep mode f (mhz) 20.0 16.0 6.25 2.0 0 2.2 2.7 3.0 3.6 5.5 vcc (v) avcc f (khz) 32.768 0 2.2 2.7 3.6 5.5 vcc (v) vcc (v) vcc (v) vcc (v) subclock system clock t (ns) 50.0 62.5 160 500 0 2.2 2.7 3.0 3.6 5.5 vcc (v) t ( s) 30.5 0 2.2 2.7 3.6 5.5 3.6 5.5 subclock system clock f (mhz) 20.0 16.0 6.25 2.0 0 2.2 2.7 3.0 3.6 5.5 vcc (v) avcc f (khz) 32.768 0 2.2 2.7 3.6 5.5 subclock system clock t (ns) 50.0 62.5 160 500 0 2.2 2.7 3.0 3.6 5.5 vcc (v) t ( s) 30.5 0 2.2 2.7 subclock all operating mode all operating mode subactive mode subactive mode active (high/medium speed) mode sleep mode active (high/medium speed) mode active (high/medium speed) mode figure 27.2 power supply voltage and operating ranges (h8s/2239 group)
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 841 of 982 rej09b0054-0500 system clock (1) power supply voltage and oscillation frequency range (f-ztat version) active (high-speed/medium-speed) mode sleep mode f (mhz) 13.5 6.25 2.0 0 2.2 2.7 3.0 3.6 5.5 vcc (v) all operating modes f (khz) 32.768 0 2.2 3.0 2.7 3.6 5.5 system clock (3) power supply voltage and instruction execution range (f-ztat version) active (high-speed/medium-speed) mode t (ns) 74 160 500 0 2.2 2.7 3.0 3.6 5.5 vcc (v) subactive mode t ( s) 30.5 0 2.2 3.0 2.7 3.6 5.5 3.6 5.5 system clock (2) power supply voltage and oscillation frequency range (masked rom version) active (high-speed/medium-speed) mode sleep mode f (mhz) 13.5 6.25 2.0 0 2.2 2.7 3.6 5.5 vcc (v) all operating modes f (khz) 32.768 0 2.2 2.7 3.0 3.6 5.5 system clock (4) power supply voltage and instruction execution range (masked rom version) active (high-speed/medium-speed) mode t (ns) 74 160 6.25 500 0 (5) analog power supply voltage and oscillation frequency range (f-ztat version, masked rom version) 2.2 2.7 2.2 2.7 3.6 5.5 vcc (v) subactive mode t ( s) 30.5 0 2.2 2.7 3.0 subclock subclock subclock subclock vcc (v) vcc (v) vcc (v) vcc (v) system clock active (high-speed/medium-speed) mode sleep mode f (mhz) 13.5 2.0 0 3.6 5.5 avcc (v) note: see sections 27.4.4, a/d convesion characteristics and 27.4.5, d/a convesion characteristics for the operation range of avcc. figure 27.3 power supply voltage and operating ranges (h8s/2238b and h8s/2236b)
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 842 of 982 rej09b0054-0500 13.5 6.25 2.0 0 2.2 2.7 3.6 5.5 32.768 0 2.2 2.7 3.6 5.5 74 160 500 0 2.2 2.7 3.6 5.5 30.5 0 2.2 2.7 3.6 5.5 3.6 5.5 13.5 6.25 2.0 0 2.2 2.7 3.6 5.5 32.768 0 2.2 2.7 3.6 5.5 74 160 500 0 2.2 2.7 3.6 5.5 30.5 0 2.2 2.7 system clock (2) power supply voltage/analog power supply voltage and oscilllation frequency range (f-ztat-version regular specifications/masked rom version) (1) power supply voltage/analog power supply voltage and oscilllation frequency range (f-ztat-version wide-range specifications) (4) power supply voltageand instruction executing range (f-ztat-version regular specifications/masked rom version) note: the emulator does not operate at 2.2 v. (3) power supply voltage and instruction executing range (f-ztat-version wide-range specifications) active (high/medium speed) mode sleep mode f (mhz) vcc (v) avcc f (khz) f (khz) vcc (v) vcc (v) vcc (v) vcc (v) subclock system clock t (ns) vcc (v) t ( s) subclock system clock f (mhz) vcc (v) avcc 32.768 subclock system clock t (ns) vcc (v) t ( s) subclock all operating mode all operating mode subactive mode subactive mode active (high/medium speed) mode sleep mode active (high/medium speed) mode active (high/medium speed) mode figure 27.4 power supply voltage and operating ranges (h8s/2238r and h8s/2236r)
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 843 of 982 rej09b0054-0500 13.5 10.0 6.25 2.0 2.2 2.7 3.0 3.6 32.768 0 2.2 2.7 3.0 3.6 74 100 160 500 0 2.2 2.7 3.0 3.6 30.5 0 2.2 2.7 3.0 3.6 3.0 3.6 13.5 10.0 6.25 2.0 0 2.2 2.7 3.0 3.6 32.768 0 2.2 2.7 3.0 3.6 74 100 160 500 0 2.2 2.7 3.0 3.6 30.5 0 2.2 2.7 13.5 6.25 2.0 0 2.2 2.7 3.0 3.6 32.768 0 2.2 2.7 3.0 3.6 74 160 500 0 2.2 2.7 3.0 3.6 30.5 0 2.2 2.7 3.0 3.6 system clock (3) power supply voltage and oscilllation frequency range (masked rom version) (4) power supply voltage and instruction executing range (ztat version) (1) power supply voltage oscilllation frequency range (ztat version) (2) power supply voltage/analog power supply voltage and oscilllation frequency range (f-ztat version) (6) power supply voltageand and instruction executing range (masked rom version) (5) power supply voltage and instruction executing range (f-ztat version) f (mhz) vcc (v) avcc f (khz) vcc (v) vcc (v) vcc (v) vcc (v) subclock system clock vcc (v) system clock f (mhz) vcc (v) avcc f (khz) f (mhz) f (khz) system clock t (ns) vcc (v) t ( s) t (ns) t ( s) t (ns) t ( s) system clock subclock subclock subclock subclock system clock subclock active (high/medium speed) mode sleep mode all operating mode all operating mode active (high/medium speed) mode sleep mode all operating mode active (high/medium speed) mode sleep mode all operating mode active (high/medium speed) mode sleep mode subactive mode subactive mode active (high/medium speed) mode active (high/medium speed) mode figure 27.5 power supply voltage and operating ranges (h8s/2237 group and h8s/2227 group)
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 844 of 982 rej09b0054-0500 27.2 electrical characteristics of h8s/2258 group 27.2.1 absolute maximum ratings table 27.1 lists the absolute maximum ratings. table 27.1 absolute maximum ratings item symbol value unit v cc ? 0.3 to +7.0 v power supply voltage cv cc ? 0.3 to +4.3 v input voltage (except ports 4 and 9) v in ? 0.3 to v cc +0.3 v input voltage (ports 4 and 9) v in ? 0.3 to av cc +0.3 v reference power supply voltage v ref ? 0.3 to av cc +0.3 v analog power supply voltage av cc ? 0.3 to +7.0 v analog input voltage v an ? 0.3 to av cc +0.3 v t opr regular specifications: ?20 to +75 * c operating temperature wide-range specifications: ?40 to +85 * storage temperature t stg ?55 to +125 c caution: permanent damage to the chip may result if absolute maximum ratings are exceeded. note: * the operating temperature ranges for flash memory programming/erasing are ta = ? 20 c to +75 c (regular specifications).
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 845 of 982 rej09b0054-0500 27.2.2 dc characteristics table 27.2 lists the dc characteristics. table 27.3 lists the permissible output currents. table 27.4 lists the bus driving characteristics. table 27.2 dc characteristics (1) conditions: v cc = 4.0 v to 5.5 v, av cc = 4.0 v to 5.5 v, v ref = 4.0 v to av cc , v ss = av ss = 0 v, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) * 1 item symbol min typ max unit test conditions vt ? v cc 0.2 ?? v vt + ?? v cc 0.8 v schmitt trigger input voltage irq0 to irq7 vt + ? vt ? v cc 0.05 ?? v res , stby , nmi, md2 to md0, fwe v cc 0.9 ? v cc + 0.3 v extal, ports 1, 3, 7, and a to g v cc 0.8 ? v cc + 0.3 v input high voltage ports 4 and 9 v ih v cc 0.8 ? av cc + 0.3 v res , stby , md2 to md0, fwe ?0.3 ? v cc 0.1 v input low voltage nmi, extal, ports 1, 3, 4, 7, 9, and a to g v il ?0.3 ? v cc 0.2 v v cc ? 0.5 ?? vi oh = ?200 a all output pins * 3 except p34 and p35 v cc ? 1.0 ?? vi oh = ?1 ma output high voltage p34 and p35 * 2 v oh v cc ? 2.7 ?? vi oh = ?100 a ?? 0.4 v i ol = 0.4 ma output low voltage all output pins * 3 v ol ?? 0.4 v i ol = 0.8 ma
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 846 of 982 rej09b0054-0500 item symbol min typ max unit test conditions res ?? 1.0 a stby , nmi, md2 to md0, fwe ?? 1.0 a v in = 0.5 to v cc ? 0.5 v input leakage current ports 4 and 9 | i in | ?? 1.0 a v in = 0.5 to av cc ? 0.5 v three states leakage current (off) ports 1, 3, 7, and a to g | i tsi | ?? 1.0 a v in = 0.5 to v cc ? 0.5 v input pull-up mos current ports a to e ?i p 10 ? 300 a v in = 0v notes: 1. if the a/d or d/a converter is not used, the avcc, v ref , and avss pins should not be open. even if the a/d or d/a converter is not used, connect the avcc and v ref pins to v cc and supply 4.0 v to 5.5 v. in this case, v ref av cc . 2. p35/sck1/scl0 and p34/sda0 function as nmos push-pull output. to output the high voltage from scl0 and sda0 (ice = 1), connect an external pull-up resistor. nmos controls p35/sck1 and p34 (ice = 0) to output the high voltage. 3. in the case when iics = 0 and ice = 0. low voltage output of scl1, scl0, sda1, and sda0 with bus driving function is specified in table 27.4.
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 847 of 982 rej09b0054-0500 table 27.2 dc characteristics (2) conditions (f-ztat version):v cc = 4.0 v to 5.5 v, av cc = 4.0 v to 5.5 v, v ref = 4.0 v to av cc , v ss = av ss = 0 v, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) * 1 item symbol min typ max unit test conditions res ?? 30 pf input capacitance nmi ?? 30 pf p32 to p35 ?? 20 pf all input pins other than above ones c in ?? 15 pf v in = 0 v, f = 1 mhz, t a = 25 c current consumption * 2 normal operation i cc * 4 ? 28 v cc = 5.0 v 40 v cc = 5.5 v ma f = 13.5 mhz sleep mode ? 22 v cc = 5.0 v 30 v cc = 5.5 v ma f = 13.5 mhz all modules stopped ? 14 ? ma f = 13.5 mhz, v cc = 5.0 v (reference value) medium- speed mode ( /32) ? 17 ? ma f = 13.5 mhz, v cc = 5.0 v (reference value) subactive mode ? 90 180 a when 32.768 khz crystal resonator is used, v cc = 5.0 v subsleep mode ? 70 140 a when 32.768 khz crystal resonator is used, v cc = 5.0 v watch mode ? 8 40 a when 32.768 khz crystal resonator is used, v cc = 5.0 v
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 848 of 982 rej09b0054-0500 item symbol min typ max unit test conditions current consumption * 2 i cc * 4 ? 1.5 10 a t a 50 c, when 32.768 khz crystal resonator is not used standby mode * 3 ?? 50 50 c < t a , when 32.768 khz crystal resonator is not used during a/d or d/a conversion ? 0.4 1.5 ma analog power supply current waiting for a/d or d/a conversion al cc ? 0.01 5.0 a during a/d or d/a conversion al cc ? 2.1 3.5 ma reference power supply current waiting for a/d or d/a conversion ? 0.01 5.0 a ram standby voltage v ram 2.0 ?? v notes: 1. if the a/d or d/a converter is not used, the avcc, v ref , and avss pins should not be open. even if the a/d or d/a converter is not used, connect the avcc and v ref pins to v cc and supply 4.0 v to 5.5 v. in this case, v ref av cc . 2. current consumption values are for v ih min = v cc ? 0.5 v and v il max = 0.5 v, with all output pins unloaded and the on-chip mos pull-up transistors in the off state. 3. the values are for v ram v cc < 4.0 v, v ih min = v cc 0.9, and v il max = 0.3 v. 4. i cc depends on v cc and f as follows: i cc max. = 2.0 (ma) + 0.7 (ma/v) v cc + 1.4 (ma/mhz) f + 0.20 (ma/(mhz ? v)) v cc f (normal operation) i cc max. = 1.5 (ma) + 0.6 (ma/v) v cc + 1.1 (ma/mhz) f + 0.15 (ma/(mhz ? v)) v cc f (sleep mode)
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 849 of 982 rej09b0054-0500 table 27.2 dc characteristics (3) conditions (masked rom version):v cc = 4.0 v to 5.5 v, av cc = 4.0 v to 5.5 v, v ref = 4.0 v to av cc , v ss = av ss = 0 v, t a = ?20 c c to +75 c (regular specifications), t a = ?40 c to +85 c (wide- range specifications) * 1 item symbol min typ max unit test conditions res ?? 30 pf input capacitance nmi ?? 30 pf p32 to p35 ?? 20 pf all input pins other than above ones c in ?? 15 pf v in = 0 v, f = 1 mhz, t a = 25c current consumption * 2 normal operation i cc * 4 ? 25 v cc = 5.0 v 40 v cc = 5.5 v ma f = 13.5 mhz sleep mode ? 20 v cc = 5.0 v 30 v cc = 5.5 v ma f = 13.5 mhz all modules stopped ? 13 ? ma f = 13.5 mhz, v cc = 5.0 v (reference value) medium- speed mode ( /32) ? 15 ? ma f = 13.5 mhz, v cc = 5.0 v (reference value) subactive mode ? 70 180 a when 32.768 khz crystal resonator is used, v cc = 5.0 v subsleep mode ? 50 100 a when 32.768 khz crystal resonator is used, v cc = 5.0 v watch mode ? 8 40 a when 32.768 khz crystal resonator is used, v cc = 5.0 v
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 850 of 982 rej09b0054-0500 item symbol min typ max unit test conditions current consumption * 2 i cc * 4 ? 1.0 10 a t a 50 c, when 32.768 khz crystal resonator is not used standby mode * 3 ?? 50 50 c < t a , when 32.768 khz crystal resonator is not used during a/d or d/a conversion ? 0.4 1.5 ma analog power supply current waiting for a/d or d/a conversion al cc ? 0.01 5.0 a during a/d or d/a conversion al cc ? 2.1 3.5 ma reference power supply current waiting for a/d or d/a conversion ? 0.01 5.0 a ram standby voltage v ram 2.0 ?? v notes: 1. if the a/d or d/a converter is not used, the avcc, v ref , and avss pins should not be open. even if the a/d or d/a converter is not used, connect the avcc and v ref pins to v cc and supply 4.0 v to 5.5 v. in this case, v ref av cc . 2. current consumption values are for v ih min = v cc ? 0.5 v and v il max = 0.5 v, with all output pins unloaded and the on-chip mos pull-up transistors in the off state. 3. the values are for v ram v cc < 4.0 v, v ih min = v cc 0.9, and v il max = 0.3 v. 4. i cc depends on v cc and f as follows: i cc max. = 2.0 (ma) + 0.7 (ma/v) v cc + 1.4 (ma/mhz) f + 0.20 (ma/(mhz ? v)) v cc f (normal operation) i cc max. = 1.5 (ma) + 0.6 (ma/v) v cc + 1.1 (ma/mhz) f + 0.15 (ma/(mhz ? v)) v cc f (sleep mode)
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 851 of 982 rej09b0054-0500 table 27.3 permissible output current conditions: v cc = 4.0 v to 5.5 v, av cc = 4.0 v to 5.5 v, v ref = 4.0 v to av cc , v ss = av ss = 0 v, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) item symbol min typ max unit scl1, scl0, sda1, sda0 ?? 10 permissible output low current (per pin) output pins other than above ones v cc = 4.0 v to 5.5 v i ol ?? 1.0 ma permissible output low current (total) total of all output pins * v cc = 4.0 v to 5.5 v i ol ?? 60 ma permissible output high current (per pin) all output pins v cc = 4.0 v to 5.5 v ?i oh ?? 1.0 ma permissible output high current (total) total of all output pins v cc = 4.0 v to 5.5 v ?i oh ?? 30 ma note: * to protect chip reliability, do not exceed the output current values in table 27.3.
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 852 of 982 rej09b0054-0500 table 27.4 bus driving characteristics conditions: v cc = 4.0 v to 5.5 v, av cc = 4.0 v to 5.5 v, v ref = 4.0 v to av cc , v ss = av ss = 0 v, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications)* objective pins: scl1, scl0, sda1, and sda0 item symbol min typ max unit test conditions vt ? v cc 0.3 ?? v cc = 4.0 v to 5.5 v vt + ?? v cc 0.7 v cc = 4.0 v to 5.5 v schmitt trigger input voltage vt + ? vt ? 0.4 ?? v v cc = 4.0 v to 5.5 v input high voltage v ih v cc 0.7 ? v cc + 0.5 v v cc = 4.0 v to 5.5 v input low voltage v il ?0.5 ? v cc 0.3 v v cc = 4.0 v to 5.5 v ?? 0.5 i ol = 8 ma output low voltage v ol ?? 0.4 v i ol = 3 ma input capacitance c in ?? 20 pf v in = 0 v, f = 1 mhz, t a = 25c three states leakage current (off) | i tsi | ?? 1.0 a v in = 0.5 v to v cc ? 0.5 v scl, sda output falling time t of 20 + 0.1 cb ? 250 ns v cc = 4.0 v to 5.5 v note: * if the a/d or d/a converter is not used, the avcc, v ref , and avss pins should not be open. even if the a/d or d/a converter is not used, connect the avcc and v ref pins to v cc and supply 4.0 v to 5.5 v. in this case, v ref av cc .
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 853 of 982 rej09b0054-0500 27.2.3 ac characteristics figure 27.6 shows the test conditions for the ac characteristics. 5 v r l r h c lsi output pin c = 30 pf r l = 2.4 k ? r h = 12 k ? input/output timing measurement levels  low level: 0.8 v  high level: 2.0 v (v cc = 4.0 to 5.5 v) figure 27.6 output load circuit
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 854 of 982 rej09b0054-0500 (1) clock timing table 27.5 lists the clock timing. table 27.5 clock timing condition a: v cc = 4.0 v to 5.5 v, av cc = 4.0 v to 5.5 v, v ref = 4.0 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 10 to 13.5 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition a item symbol min max unit test conditions clock cycle time t cyc 74 100 ns clock high pulse width t ch 25 ? ns clock low pulse width t cl 25 ? ns clock rise time t cr ? 10 ns clock fall time t cf ? 10 ns figure 27.10 oscillation stabilization time at reset (crystal) t osc1 20 ? ms figure 27.11 oscillation stabilization time in software standby (crystal) t osc2 8 ? ms external clock output stabilization delay time t dext 500 ? s figure 27.11 32-khz clock oscillation stabilization time t osc3 ? 2s subclock oscillator frequency f sub 32.768 32.768 khz subclock ( sub ) cycle time t sub 30.5 30.5 s
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 855 of 982 rej09b0054-0500 (2) control signal timing table 27.6 lists the control signal timing. table 27.6 control signal timing condition a: v cc = 4.0 v to 5.5 v, av cc = 4.0 v to 5.5 v, v ref = 4.0 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 10 to 13.5 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition a item symbol min min unit test conditions res setup time t ress 250 ? ns res pulse width t resw 20 ? t cyc mres setup time t mress 250 ? ns mres pulse width t mresw 20 ? t cyc figure 27.12 nmi setup time t nmis 250 ? ns nmi hold time t nmih 10 ? ns nmi pulse width (exiting software standby mode) t nmiw 200 ? ns irq setup time t irqs 250 ? ns irq hold time t irqh 10 ? ns irq pulse width (exiting software standby mode) t irqw 200 ? ns figure 27.13
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 856 of 982 rej09b0054-0500 (3) bus timing table 27.7 lists the bus timing. table 27.7 bus timing condition a: v cc = 4.0 v to 5.5 v, av cc = 4.0 v to 5.5 v, v ref = 4.0 v to av cc , v ss = av ss = 0 v, = 10 to 13.5 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition a item symbol min max unit test conditions address delay time t ad ? 50 ns address setup time t as 0.5 t cyc ? 30 ? ns figures 27.14 to 27.18 address hold time t ah 0.5 t cyc ? 15 ? ns cs delay time t csd ? 50 ns as delay time t asd ? 50 ns rd delay time 1 t rsd1 ? 50 ns rd delay time 2 t rsd2 ? 50 ns read data setup time t rds 30 ? ns read data hold time t rdh 0 ? ns read data access time 1 t acc1 ? 1.0 t cyc ? 65 ns read data access time 2 t acc2 ? 1.5 t cyc ? 65 ns read data access time 3 t acc3 ? 2.0 t cyc ? 65 ns read data access time 4 t acc4 ? 2.5 t cyc ? 65 ns read data access time 5 t acc5 ? 3.0 t cyc ? 65 ns wr delay time 1 t wrd1 ? 50 ns wr delay time 2 t wrd2 ? 50 ns wr pulse width 1 t wsw1 1.0 t cyc ? 30 ? ns wr pulse width 2 t wsw2 1.5 t cyc ? 30 ? ns write data delay time t wdd ? 70 ns write data setup time t wds 0.5 t cyc ? 37 ? ns write data hold time t wdh 0.5 t cyc ? 15 ? ns wait setup time t wts 50 ? ns wait hold time t wth 10 ? ns figure 27.16 breq setup time t brqs 50 ? ns back delay time t bacd ? 50 ns bus-floating time t bzd ? 80 ns figure 27.19
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 857 of 982 rej09b0054-0500 (4) timing of on-chip peripheral modules table 27.8 lists the timing of on-chip peripheral modules. table 27.8 timing of on-chip peripheral modules condition a: v cc = 4.0 v to 5.5 v, av cc = 4.0 v to 5.5 v, v ref = 4.0 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 10 to 13.5 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition a item symbol min max unit test conditions output data delay time t pwd ? 100 ns input data setup time t prs 50 ? i/o ports input data hold time t prh 50 ? figure 27.24 tpu timer output delay time t tocd ? 100 ns timer input setup time t tics 40 ? figure 27.25 timer clock input setup time t tcks 40 ? ns figure 27.26 single edge t tckwh 1.5 ? t cyc timer clock pulse width both edges t tckwl 2.5 ? tmr timer output delay time t tmod ? 100 ns figure 27.27 timer reset input setup time t tmrs 50 ? ns figure 27.29 timer clock input setup time t tmcs 50 ? ns figure 27.28 single edge t tmcwh 1.5 ? timer clock pulse width both edges t tmcwl 2.5 ? t cyc wdt1 buzz output delay time t buzd ? 100 ns figure 27.30 sci asynchronous t scyc 4 ? t cyc input clock cycle synchronous 6 ? input clock pulse width t sckw 0.4 0.6 t scyc input clock rise time t sckr ? 1.5 t cyc input clock fall time t sckf ? 1.5 figure 27.31 transmit data delay time t txd ? 100 ns receive data setup time (synchronous) t rxs 75 ? ns receive data hold time (synchronous) t rxh 75 ? ns figure 27.32 a/d converter trigger input setup time t trgs 40 ? ns figure 27.33
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 858 of 982 rej09b0054-0500 table 27.9 i 2 c bus timing conditions: v cc = 4.0 v to 5.5 v, v ss = 0 v, = 5 mhz to maximum operating frequency, t a = ?20c to +75c standard value item symbol min typ max unit test conditions scl input cycle time t scl 12 ?? t cyc scl input high pulse width t sclh 3 ?? t cyc scl input low pulse width t scll 5 ?? t cyc scl, sda input rise time t sr ?? 7.5 * t cyc scl, sda input fall time t sf ?? 300 ns scl, sda input spike pulse elimination time t sp ?? 1t cyc sda input bus free time t buf 5 ?? t cyc start condition input hold time t stah 3 ?? t cyc retransmission start condition input setup time t stas 3 ?? t cyc stop condition input setup time t stos 3 ?? t cyc data input setup time t sdas 0.5 ?? t cyc data input hold time t sdah 0 ?? ns scl, sda load capacitance c b ?? 400 pf figure 27.7 note: * can be 7.5 t cyc or 17.5 t cyc depending on the clock used in the i 2 c module. for details, see section 16.6, usage notes.
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 859 of 982 rej09b0054-0500 t buf t stah t stas t sp t stos t sclh t scll t sf t sr t scl t sdah t sdas p * s * s r * v ih v il sda0 to sda1 scl0 to scl1 note: * s, p, and sr indicate the following conditions. s: start condition p: stop condition sr: retransmission start condition figure 27.7 i 2 c bus interface input/output timing (optional)
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 860 of 982 rej09b0054-0500 27.2.4 a/d conversion characteristics table 27.10 lists the a/d conversion characteristics. table 27.10 a/d conversion characteristics condition a: v cc = 4.0 v to 5.5 v, av cc = 3.0 v to 3.6 v, v ref = 3.0 v to av cc , v ss = av ss = 0 v, = 10 to 13.5 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition a item min typ max unit resolution 10 10 10 bits conversion time 9.6 ?? s analog input capacitance ?? 20 pf permissible signal-source impedance ?? 5k ? non-linearity error ?? 6.0 lsb offset error ?? 4.0 lsb full-scale error ?? 4.0 lsb quantization error ?? 0.5 lsb absolute accuracy ?? 8.0 lsb
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 861 of 982 rej09b0054-0500 27.2.5 d/a conversion characteristics table 27.11 lists the d/a conversion characteristics. table 27.11 d/a conversion characteristics condition a: v cc = 4.0 v to 5.5 v, av cc = 4.0 v to 5.5 v, v ref = 4.0 v to av cc , v ss = av ss = 0 v, = 10 to 13.5 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition a item min typ max unit test conditions resolution 888bits conversion time ?? 10 s load capacitance: 20 pf ? 2.0 3.0 lsb load resistance: 2 m ? absolute accuracy ?? 2.0 lsb load resistance: 4 m ?
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 862 of 982 rej09b0054-0500 27.2.6 flash memory characteristics table 27.12 flash memory characteristics conditions: v cc = 4.0 v to 5.5 v, av cc = 4.0 v to 5.5 v, v ref = 4.0 v to av cc , v ss = av s s = 0 v, t a = ?20 c to +75 c (programming/erasing operating temperature range) item symbol min typ max unit test conditions programming time * 1 * 2 * 4 t p ? 40 200 ms/ 128 bytes erase time * 1 * 3 * 5 t e ? 20 1000 ms/block reprogramming count n wec 100 * 6 10000 * 7 ? times data hold time * 8 t drp 10 ?? year programming wait time after swe1 bit setting * 1 t sswe 11 ? s wait time after psu1 bit setting * 1 t spsu 50 50 ? s t sp10 81012s t sp30 28 30 32 s 1 n 6 wait time after p1 bit setting * 1 * 4 t sp200 198 200 202 s 7 n 1000 wait time after p1 bit clear * 1 t cp 55 ? s wait time after psu1 bit clear * 1 t cpsu 55 ? s wait time after pv1 bit setting * 1 t spv 44 ? s wait time after h'ff dummy write * 1 t spvr 22 ? s wait time after pv1 bit clear * 1 t cpv 22 ? s wait time after swe1 bit clear * 1 t cswe 100 100 ? s n1 ?? 6 * 4 maximum programming count * 1 * 4 n2 ?? 994 * 4 times erase wait time after swe1 bit setting * 1 t sswe 11 ? s wait time after esu1 bit setting * 1 t sesu 100 100 ? s wait time after e1 bit setting * 1 * 5 t se 10 10 100 ms wait time after e1 bit clear * 1 t ce 10 10 ? s wait time after esu1 bit clear * 1 t cesu 10 10 ? s wait time after ev1 bit setting * 1 t sev 20 20 ? s wait time after h'ff dummy write * 1 t sevr 22 ? s wait time after ev1 bit clear * 1 t cev 44 ? s wait time after swe1 bit clear * 1 t cswe 100 100 ? s maximum erase count * 1 * 5 n ?? 100 times
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 863 of 982 rej09b0054-0500 notes: 1. follow the program/erase algorithms when making the time settings. 2. programming time per 128 bytes (shows the total period for which the p1 bit in the flash memory control register 1 (flmcr1) is set. it does not include the program verification time.) 3. erase block time (shows the total period for which the e1 bit in flmcr1 is set. it does not include the erase verification time.) 4. maximum programming time t p (max) = wait time after p1 bit setting (t sp ) maximum programming count (n) (t sp30 + t sp10 ) 6 + (t sp200 ) 994 5. for the maximum erase time (t e (max)), the following relationship applies between the wait time after e1 bit setting (z) and the maximum erase count (n): t e (max) = wait time after e1 bit setting (t se ) maximum erase count (n) 6. the minimum times that all characteristics after reprogramming are guaranteed. (the range between 1 and a minimum value is guaranteed.) 7. reference value at 25 c. (normally, it is a reference that rewriting is enabled up to this value.) 8. data hold characteristics are when reprogramming is performed within the range of specifications including a minimum value.
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 864 of 982 rej09b0054-0500 27.3 electrical characteristics of h8s/2239 group 27.3.1 absolute maximum ratings table 27.13 lists the absolute maximum ratings. table 27.13 absolute maximum ratings item symbol value unit v cc ?0.3 to +4.3 v power supply voltage cv cc ?0.3 to +4.3 v input voltage (except ports 4 and 9) v in ?0.3 to v cc +0.3 v input voltage (ports 4 and 9) v in ?0.3 to av cc +0.3 v reference power supply voltage v ref ?0.3 to av cc +0.3 v analog power supply voltage av cc ?0.3 to +4.3 v analog input voltage v an ?0.3 to av cc +0.3 v operating temperature t opr regular specifications: ?20 to +75 * wide-range specifications: ?40 to +85 * c storage temperature t stg ?55 to +125 c caution: permanent damage to the chip may result if absolute maximum rating are exceeded. note: * the operating temperature ranges for flash memory programming/erasing are t a = ?20 c to +50 c (regular specifications).
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 865 of 982 rej09b0054-0500 27.3.2 dc characteristics table 27.14 lists the dc characteristics. table 27.15 lists the permissible output currents. table 27.16 lists the bus driving characteristics. table 27.14 dc characteristics (1) condition a (f-ztat version): v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, t a = ?20 c to +75 c (regular specifications) * 1 condition b (masked rom version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss = av ss = 0 v, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide- range specifications) * 1 condition c (f-ztat version and masked rom version): v cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, v ref = 3.0 v to av cc , v ss = av ss = 0 v, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide- range specifications) item symbol min typ max unit test conditions irq0 to irq7 vt ? v cc 0.2 ?? v vt + ?? v cc 0.8 v schmitt trigger input voltage vt + ? vt ? v cc 0.05 ?? v input high voltage res , stby , nmi, fwe, md2 to md0 v ih v cc 0.9 ? v cc + 0.3 v extal, ports 1, 3, 7, and a to g v cc 0.8 ? v cc + 0.3 v ports 4 and 9 v cc 0.8 ? av cc + 0.3 v input low voltage res , stby , fwe, md2 to md0 v il ?0.3 ? v cc 0.1 v nmi, extal, ports 1, 3, 4, 7, 9, and a to g ?0.3 ? v cc 0.2 v
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 866 of 982 rej09b0054-0500 item symbol min typ max unit test conditions v oh v cc ? 0.5 ?? vi oh = ?200 a output high voltage all output pins * 4 except p34 and p35 v cc ? 1.0 ?? vi oh = ?1 ma * 2 p34 and p35 * 3 v cc ? 2.0 ?? vi oh = ?100 a (reference value) ?? 0.4 v i ol = 0.4 ma output low voltage all output pins * 4 v ol ?? 0.4 v i ol = 0.8 ma * 2 res ?? 1.0 a input leakage current stby , nmi, fwe, md2 to md0 ?? 1.0 a v in = 0.2 to v cc ? 0.2 v ports 4, 9 | i in | ?? 1.0 a v in = 0.2 to av cc ? 0.2 v three states leakage current (off) ports 1, 3, 7, and a to g | i tsi | ?? 1.0 a v in = 0.2 to v cc ? 0.2 v input pull-up mos current ports a to e ?i p 10 ? 300 a v in = 0v notes: 1. if the a/d or d/a converter is not used, the av cc , v ref , and av ss pins should not be open. even if the a/d or d/a converter is not used, connect the av cc and v ref pins to v cc and supply 2.0 v to 3.6 v. in this case, v ref av cc . 2. v cc = 2.7 v to 3.6 v 3. p35/sck1 and p34 function as nmos push-pull output. to output the high voltage, connect an external pull-up resistor. 4. in the case when ice = 0. low voltage output with bus driving function is specified in table 27.16.
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 867 of 982 rej09b0054-0500 table 27.14 dc characteristics (2) condition a (f-ztat version): v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, t a = ?20 c to +75 c (regular specifications) * 1 condition c (f-ztat version): v cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, v ref = 3.0 v to av cc , v ss = av ss = 0 v, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) item symbol min typ max unit test conditions res ?? 30 pf input capacitance nmi ?? 30 pf p32 to p35 ?? 20 pf all input pins other than above ones c in ?? 15 pf v in = 0 v, f = 1 mhz, t a = 25 c current consumption * 2 normal operation i cc * 4 ? 29 v cc = 3.0 v 55 v cc = 3.6 v ma f = 20.0 mhz ? 25 v cc = 3.0 v 42 v cc = 3.6 v ma f = 16.0 mhz sleep mode ? 19 v cc = 3.0 v 43 v cc = 3.6 v ma f = 20.0 mhz ? 17 v cc = 3.0 v 32 v cc = 3.6 v ma f = 16.0 mhz all modules stopped ? 16 ? ma f = 20.0 mhz, v cc = 3.0 v (reference value) ? 15 ? ma f = 16.0 mhz, v cc = 3.0 v (reference value) medium- speed mode ( /32) ? 15 ? ma f = 20.0 mhz, v cc = 3.0 v (reference value) ? 13 ? ma f = 16.0 mhz, v cc = 3.0 v (reference value)
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 868 of 982 rej09b0054-0500 item symbol min typ max unit test conditions current consumption * 2 subactive mode i cc * 4 ? 70 180 a v cc = 3.0 v, when 32.768 khz crystal resonator is used subsleep mode ? 50 130 a v cc = 3.0 v, when 32.768 khz crystal resonator is used watch mode ? 840av cc = 3.0 v, when 32.768 khz crystal resonator is used ? 1.0 v cc = 3.0 v 10 v cc = 3.6 v a t a 50 c, when 32.768 khz crystal resonator is not used standby mode * 3 ?? 50 v cc = 3.6 v a 50 c < t a , when 32.768 khz crystal resonator is not used during a/d conversion ? 0.5 1.5 ma analog power supply current idle al cc ? 0.01 5.0 a during a/d conversion al cc ? 1.3 2.5 ma reference power supply current idle ? 0.01 5.0 a ram standby voltage v ram 2.0 ?? v notes: 1. if the a/d or d/a converter is not used, the av cc , v ref , and av ss pins should not be open. even if the a/d or d/a converter is not used, connect the av cc and v ref pins to v cc and supply 2.0 v to 3.6 v. in this case, v ref av cc . 2. current consumption values are for v ih min = v cc ? 0.2 v and v il max = 0.2 v, with all output pins unloaded and the on-chip mos pull-up transistors in the off state. 3. the values are for v ram v cc < 2.7 v, v ih min = v cc ? 0.2, and v il max = 0.2 v. 4. i cc depends on v cc and f as follows: i cc max = 1.0 (ma) + 0.74 (ma/(mhz v)) v cc f (normal operation) i cc max = 1.0 (ma) + 0.58 (ma/(mhz v)) v cc f (sleep mode)
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 869 of 982 rej09b0054-0500 table 27.14 dc characteristics (3) condition b (masked rom version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss = av ss = 0 v, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide- range specifications) * 1 condition c (f-ztat version): v cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, v ref = 3.0 v to av cc , v ss = av ss = 0 v, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide- range specifications) item symbol min typ max unit test conditions res ?? 30 pf nmi ?? 30 pf p32 to p35 ?? 20 pf input capacitance all input pins other than above ones c in ?? 15 pf v in = 0 v, f = 1 mhz, t a = 25c normal operation i cc * 4 ? 29 v cc = 3.0 v 55 v cc = 3.6 v ma f = 20.0 mhz current consumption * 2 ? 25 v cc = 3.0 v 42 v cc = 3.6 v ma f = 16.0 mhz ? 10 v cc = 3.0 v 18 v cc = 3.6 v ma f = 6.25 mhz sleep mode ? 19 v cc = 3.0 v 43 v cc = 3.6 v ma f = 20.0 mhz ? 17 v cc = 3.0 v 32 v cc = 3.6 v ma f = 16.0 mhz ? 7.5 v cc = 3.0 v 14 v cc = 3.6 v ma f = 6.25 mhz all modules stopped ? 16 ? ma f = 20.0 mhz, v cc = 3.0 v (reference value) ? 15 ? ma f = 16.0 mhz, v cc = 3.0 v (reference value)
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 870 of 982 rej09b0054-0500 item symbol min typ max unit test conditions current consumption * 2 medium- speed mode ( /32) i cc * 4 ? 15 ? ma f = 20.0 mhz, v cc = 3.0 v (reference value) ? 13 ? ma f = 16.0 mhz, v cc = 3.0 v (reference value) subactive mode ? 45 180 a v cc = 3.0 v, when 32.768 khz crystal resonator is used subsleep mode ? 30 100 a v cc = 3.0 v, when 32.768 khz crystal resonator is used watch mode ? 840av cc = 3.0 v, when 32.768 khz crystal resonator is used ? 0.5 v cc = 3.0 v 10 v cc = 3.6 v a t a 50c, when 32.768 khz crystal resonator is not used standby mode * 3 ?? 50 v cc = 3.6 v a 50c < t a , when 32.768 khz crystal resonator is not used during a/d conversion al cc ? 0.5 1.5 ma analog power supply current idle ? 0.01 5.0 a during a/d conversion al cc ? 1.3 2.5 ma reference power supply current idle ? 0.01 5.0 a ram standby voltage v ram 2.0 ?? v notes: 1. if the a/d or d/a converter is not used, the av cc , v ref , and av ss pins should not be open. even if the a/d or d/a converter is not used, connect the av cc and v ref pins to v cc and supply 2.0 v to 3.6 v. in this case, v ref av cc . 2. current consumption values are for v ih min = v cc ? 0.2 v and v il max = 0.2 v, with all output pins unloaded and the on-chip mos pull-up transistors in the off state. 3. the values are for v ram v cc < 2.2 v, v ih min = v cc ? 0.2, and v il max = 0.2 v. 4. i cc depends on v cc and f as follows: i cc max = 1.0 (ma) + 0.74 (ma/(mhz v)) v cc f (normal operation) i cc max = 1.0 (ma) + 0.58 (ma/(mhz v)) v cc f (sleep mode)
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 871 of 982 rej09b0054-0500 table 27.15 permissible output currents condition a (f-ztat version): v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, t a = ?20 c to +75 c (regular specifications) condition b (masked rom version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss = av ss = 0 v, t a = ?20 c to +75 c (regular specifications) t a = ?40 c to +85 c (wide- range specifications) condition c (f-ztat version): v cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, v ref = 3.0 v to av cc , v ss = av ss = 0 v, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide- range specifications) item symbol min typ max unit scl1, scl0, sda1, sda0 v cc = 2.7 v to 3.6 v i ol ?? 10 v cc = 2.2 v to 3.6 v ?? 0.5 permissible output low current (per pin) output pins other than above ones v cc = 2.7 v to 3.6 v i ol ?? 1.0 ma v cc = 2.2 v to 3.6 v ?? 30 permissible output low current (total) total of all output pins v cc = 2.7 v to 3.6 v i ol ?? 60 ma v cc = 2.2 v to 3.6 v ?? 0.5 permissible output high current (per pin) all output pins v cc = 2.7 v to 3.6 v ?i oh ?? 1.0 ma v cc = 2.2 v to 3.6 v ?? 15 permissible output high current (total) total of all output pins v cc = 2.7 v to 3.6 v ?i oh ?? 30 ma note: to protect chip reliability, do not exceed the output current values in table 27.15.
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 872 of 982 rej09b0054-0500 table 27.16 bus driving characteristics conditions: v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications)*, objective pins: scl1, scl0, sda1, sda0 item symbol min typ max unit test conditions vt ? v cc 0.3 ?? vv cc = 2.7 v to 3.6 v vt + ?? v cc 0.7 v v cc = 2.7 v to 3.6 v schmitt trigger input voltage vt + ? vt ? v cc 0.05 ?? vv cc = 2.7 v to 3.6 v input high voltage v ih v cc 0.7 ? v cc + 0.5 v v cc = 2.7 v to 3.6 v input low voltage v il ?0.5 ? v cc 0.3 v v cc = 2.7 v to 3.6 v v ol ?? 0.5 v i ol = 6 ma, v cc = 3.0 v to 3.6 v output low voltage ?? 0.4 v i ol = 3 ma input capacitance c in ?? 20 pf v in = 0 v f = 1 mhz t a = 25c three states leakage current (off) | i tsi | ?? 1.0 a v in = 0.5 v to v cc ? 0.5 v scl, sda output falling time t of 20 + 0.1 cb ? 250 ns v cc = 2.7 v to 3.6 v note: * if the a/d or d/a converter is not used, the av cc , v ref , and av ss pins should not be open. even if the a/d or d/a converter is not used, connect the av cc and v ref pins to v cc and supply 2.0 v to 3.6 v. in this case, v ref av cc .
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 873 of 982 rej09b0054-0500 27.3.3 ac characteristics figure 27.8 shows the test conditions for the ac characteristics. 3 v r l r h c lsi output pin c = 30 pf r l = 2.4 k ? r h = 12 k ? input/output timing measurement levels  low level: 0.8 v  high level: 2.0 v (v cc = 2.7 to 3.6 v) 1.5 v (v cc = 2.2 to 2.7 v) figure 27.8 output load circuit
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 874 of 982 rej09b0054-0500 (1) clock timing table 27.17 lists the clock timing. table 27.17 clock timing condition a (f-ztat version and masked rom version): v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 to 16.0 mhz, t a = ?20 c to +75 c (regular specifications) condition b (masked rom version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 to 6.25 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition c (f-ztat version and masked rom version): v cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, v ref = 3.0 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 10.0 to 20.0 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition a condition b condition c test item symbol min typ max min typ max min typ max unit conditions clock cycle time t cyc 62.5 ? 500 160 ? 500 50 ? 100 ns clock high pulse width t ch 20 ?? 50 ?? 17 ?? ns clock low pulse width t cl 20 ?? 50 ?? 17 ?? ns clock rise time t cr ?? 10 ?? 25 ?? 10 ns clock fall time t cf ?? 10 ?? 25 ?? 10 ns figure 27.10 oscillation stabilization time at reset (crystal) t osc1 20 ?? 40 ?? 20 ?? ms figure 27.11
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 875 of 982 rej09b0054-0500 condition a condition b condition c test item symbol min typ max min typ max min typ max unit conditions oscillation stabilization time in software standby (crystal) t osc2 8 ?? 16 ?? 8 ?? ms external clock output stabilization delay time t dext 500 ?? 1000 ?? 500 ?? s figure 27.11 subclock oscillation stabilization time t osc3 ?? 2 ?? 4 ?? 2s subclock oscillator frequency f sub ? 32.768 ?? 32.768 ?? 32.768 ? khz subclock ( sub ) cycle time t sub ? 30.5 ?? 30.5 ?? 30.5 ? s
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 876 of 982 rej09b0054-0500 (2) control signal timing table 27.18 lists the control signal timing. table 27.18 control signal timing condition a (f-ztat version and masked rom version): v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 to 16.0 mhz, t a = ?20 c to +75 c (regular specifications) condition b (masked rom version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 to 6.25 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition c (f-ztat version and masked rom version): v cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, v ref = 3.0 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 10.0 to 20.0 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) conditions a, c condition b item symbol min max min max unit test conditions res setup time t ress 250 ? 350 ? ns figure 27.12 res pulse width t resw 20 ? 20 ? t cyc mres setup time t mress 250 ? 350 ? ns mres pulse width t mresw 20 ? 20 ? t cyc nmi setup time t nmis 250 ? 350 ? ns figure 27.13 nmi hold time t nmih 10 ? 10 ? ns nmi pulse width (exiting software standby mode) t nmiw 200 ? 300 ? ns irq setup time t irqs 250 ? 350 ? ns irq hold time t irqh 10 ? 10 ? ns irq pulse width (exiting software standby mode) t irqw 200 ? 300 ? ns
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 877 of 982 rej09b0054-0500 (3) bus timing table 27.19 lists the bus timing. table 27.19 bus timing condition a (f-ztat version and masked rom version): v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 2 to 16.0 mhz, t a = ?20 c to +75 c (regular specifications) condition b (masked rom version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss = av ss = 0 v, = 2 to 6.25 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition c (f-ztat version and masked rom version): v cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, v ref = 3.0 v to av cc , v ss = av ss = 0 v, = 10.0 mhz to 20.0 mhz, t a = 20 c to +75 c (regular specifications), t a = 40 c to +85 c (wide-range specifications) condition a condition b condition c item symbol min max min max min max unit test conditions address delay time t ad ? 40 ? 90 ? 35 ns address setup time t as 0.5 t cyc ? 42 ? 0.5 t cyc ? 60 ? 0.5 t cyc ? 35 ? ns address hold time t ah 0.5 t cyc ? 10 ? 0.5 t cyc ? 30 ? 0.5 t cyc ? 5 ? ns figures 27.14 to 27.18 cs delay time t csd ? 40 ? 90 ? 35 ns as delay time t asd ? 40 ? 90 ? 25 ns rd delay time 1 t rsd1 ? 40 ? 90 ? 25 ns rd delay time 2 t rsd2 ? 40 ? 90 ? 25 ns read data setup time t rds 30 ? 50 ? 15 ? ns read data hold time t rdh 0 ? 0 ? 0 ? ns read data access time 1 t acc1 ? 1.0 t cyc ? 55 ? 1.0 t cyc ? 90 ?? ns
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 878 of 982 rej09b0054-0500 condition a condition b condition c item symbol min max min max min max unit test conditions read data access time 2 t acc2 ? 1.5 t cyc ? 50 ? 1.5 t cyc ? 90 ? 1.5 t cyc ? 40 ns figures 27.14 to 27.18 read data access time 3 t acc3 ? 2.0 t cyc ? 55 ? 2.0 t cyc ? 90 ? 2.0 t cyc ? 50 ns read data access time 4 t acc4 ? 2.5 t cyc ? 50 ? 2.5 t cyc ? 90 ? 2.5 t cyc ? 40 ns read data access time 5 t acc5 ? 3.0 t cyc ? 55 ? 3.0 t cyc ? 90 ? 3.0 t cyc ? 50 ns wr delay time 1 t wrd1 ? 40 ? 90 ? 25 ns wr delay time 2 t wrd2 ? 40 ? 90 ? 25 ns wr pulse width 1 t wsw1 1.0 t cyc ? 20 ? 1.0 t cyc ? 60 ? 1.0 t cyc ? 20 ? ns wr pulse width 2 t wsw2 1.5 t cyc ? 20 ? 1.5 t cyc ? 60 ? 1.5 t cyc ? 20 ? ns write data delay time t wdd ? 60 ? 100 ? 40 ns write data setup time t wds 0.5 t cyc ? 57 ? 0.5 t cyc ? 80 ? 0.5 t cyc ? 65 ? ns write data hold time t wdh 0.5 t cyc ? 27 ? 0.5 t cyc ? 60 ? 0.5 t cyc ? 20 ? ns wait setup time t wts 40 ? 90 ? 25 ? ns wait hold time t wth 10 ? 10 ? 10 ? ns figure 27.16 breq setup time t brqs 40 ? 90 ? 25 ? ns back delay time t bacd ? 40 ? 90 ? 40 ns bus-floating time t bzd ? 60 ? 160 ? 50 ns figure 27.19
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 879 of 982 rej09b0054-0500 (4) dmac timing table 27.20 lists the dmac timing. table 27.20 dmac timing condition a (f-ztat version and masked rom version): v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 2 to 16.0 mhz, t a = ?20 c to +75 c (regular specifications) condition b (masked rom version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss = av ss = 0 v, = 2 to 6.25 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition c (f-ztat version and masked rom version): v cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, v ref = 3.0 v to av cc , v ss = av ss = 0 v, = 10.0 mhz to 20.0 mhz, t a = 20 c to +75 c (regular specifications), t a = 40 c to +85 c (wide-range specifications) condition a condition b condition c item symbol min max min max min max unit test conditions dreq setup time t drqs 40 ? 60 ? 30 ? ns dreq hold time t drqh 10 ? 20 ? 10 ? ns figure 27.23 tend delay time t ted ? 30 ? 50 ? 30 ns figure 27.22 dack delay time 1 t dacd1 ? 30 ? 50 ? 30 ns figure 27.20 dack delay time 2 t dacd2 ? 30 ? 50 ? 30 ns figure 27.21
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 880 of 982 rej09b0054-0500 (5) timing of on-chip peripheral modules table 27.21 lists the timing of on-chip peripheral modules. table 27.22 lists the i 2 c bus timing. table 27.21 timing of on-chip peripheral modules condition a (f-ztat version and masked rom version): v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 to 16.0 mhz, t a = ?20 c to +75 c (regular specifications) condition b (masked rom version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 to 6.25 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition c (f-ztat version and masked rom version): v cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, v ref = 3.0 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 10.0 mhz to 20.0 mhz, t a = 20 c to +75 c (regular specifications), t a = 40 c to +85 c (wide-range specifications) condition a condition b condition c item symbol min max min max min max unit test conditions i/o port * output data delay time t pwd ? 70 ? 150 ? 50 ns figure 27.24 input data setup time t prs 50 ? 80 ? 30 ? input data hold time t prh 50 ? 80 ? 30 ? tpu timer output delay time t tocd ? 70 ? 150 ? 50 ns figure 27.25 timer input setup time t tics 40 ? 60 ? 30 ? timer clock input setup time t tcks 40 ? 60 ? 30 ? ns figure 27.26 single edge t tckwh 1.5 ? 1.5 ? 1.5 ? t cyc timer clock pulse width both edges t tckwl 2.5 ? 2.5 ? 2.5 ?
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 881 of 982 rej09b0054-0500 condition a condition b condition c item symbol min max min max min max unit test conditions tmr timer output delay time t tmod ? 70 ? 150 ? 50 ns figure 27.27 timer reset input setup time t tmrs 50 ? 80 ? 30 ? ns figure 27.29 timer clock input setup time t tmcs 50 ? 80 ? 30 ? ns figure 27.28 single edge t tmcwh 1.5 ? 1.5 ? 1.5 ? t cyc timer clock pulse width both edges t tmcwl 2.5 ? 2.5 ? 2.5 ? wdt_1 buzz output delay time t buzd ? 70 ? 150 ? 50 ns figure 27.30 sci * asynchro- nous t scyc 4 ? 4 ? 4 ? t cyc figure 27.31 input clock cycle synchro- nous 6 ? 6 ? 6 ? input clock pulse width t sckw 0.4 0.6 0.4 0.6 0.4 0.6 t scyc input clock rise time t sckr ? 1.5 ? 1.5 ? 1.5 t cyc input clock fall time t sckf ? 1.5 ? 1.5 ? 1.5 transmit data delay time t txd ? 75 ? 150 ? 50 ns figure 27.32 receive data setup time (synchronous) t rxs 75 ? 150 ? 50 ? ns receive data hold time (synchronous) t rxh 75 ? 150 ? 50 ? ns a/d converter trigger input setup time t trgs 40 ? 60 ? 30 ? ns figure 27.33 note: * nmos controls p35/sck1 and p34 to output the high voltage. to output the high voltage from p35/sck1 and p34, connect an external pull-up resistor.
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 882 of 982 rej09b0054-0500 table 27.22 i 2 c bus timing conditions: v cc = 2.7 v to 3.6 v, v ss = 0 v, = 5 mhz to maximum operating frequency, t a = ?20 c to +75 c item symbol min typ max unit test conditions scl input cycle time t scl 12 t cyc ?? ns scl input high pulse width t sclh 3 t cyc ?? ns figure 27.34 scl input low pulse width t scll 5 t cyc ?? ns scl, sda input rise time t sr ?? 7.5 t cyc * ns scl, sda input fall time t sf ?? 300 ns scl, sda input spike pulse delete time t sp ?? 1 t cyc ns sda input bus free time t buf 5 t cyc ?? ns operating condition input hold time t stah 3 t cyc ?? ns retransmitting operating condition input setup time t stas 3 t cyc ?? ns stop condition input setup time t stos 3 t cyc ?? ns data input setup time t sdas 0.5 t cyc ?? ns data input hold time t sdah 0 ?? ns scl, sda capacitor load c b ?? 400 pf note: * maximum scl and sda input rise time 7.5 t cyc or 17.5 t cyc can be selected depending on the clock that is used in the i 2 c module. for detail, see section 16.6, usage notes.
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 883 of 982 rej09b0054-0500 27.3.4 a/d conversion characteristics table 27.23 lists the a/d conversion characteristics. table 27.23 a/d conversion characteristics condition a (f-ztat version and masked rom version): v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 2 to 16.0 mhz, t a = ?20 c to +75 c (regular specifications) condition b (masked rom version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss = av ss = 0 v, = 2 to 6.25 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition c (f-ztat version and masked rom version): v cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, v ref = 3.0 v to av cc , v ss = av ss = 0 v, = 10.0 to 20.0 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) conditions a, c condition b item min typ max min typ max unit resolution 10 10 10 10 10 10 bits conversion time 8.1 ?? 20.9 ?? s analog input capacitance ?? 20 ?? 20 pf permissible signal-source impedance ?? 5 ?? 5k ? nonlinearity error ?? 6.0 ?? 6.0 lsb offset error ?? 4.0 ?? 4.0 lsb full-scale error ?? 4.0 ?? 4.0 lsb quantization error ?? 0.5 ?? 0.5 lsb absolute accuracy ?? 8.0 ?? 8.0 lsb
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 884 of 982 rej09b0054-0500 27.3.5 d/a conversion characteristics table 27.24 lists the d/a conversion characteristics. table 27.24 d/a conversion characteristics condition a (f-ztat version and masked rom version): v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 2 to 16.0 mhz, t a = ?20 c to +75 c (regular specifications) condition b (masked rom version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss = av ss = 0 v, = 2 to 6.25 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition c (f-ztat version and masked rom version): v cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, v ref = 3.0 v to av cc , v ss = av ss = 0 v, = 10.0 to 20.0 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) conditions a, c condition b item min typ max min typ max unit test condition resolution 888888bits conversion time ?? 10 ?? 10 s load capacitance = 20 pf ? 2.0 3.0 ? 3.0 4.0 lsb load resistance = 2 m ? absolute accuracy * ?? 2.0 ?? 3.0 lsb load resistance = 4 m ? note: * does not apply in module stop mode, software standby mode, watch mode, subactive mode, or subsleep mode.
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 885 of 982 rej09b0054-0500 27.3.6 flash memory characteristics table 27.25 lists the flash memory characteristics. table 27.25 flash memory characteristics conditions: v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, v cc = 3.0 v to 3.6 v (programming/erasing operating voltage range), t a = ?20 c to +50 c (programming/erasing operating temperature range; regular specifications, wide-range specifications) item symbol min typ max unit test conditions programming time * 1 * 2 * 4 t p ? 10 200 ms/128 bytes erase time * 1 * 3 * 5 t e ? 100 1200 ms/block reprogramming count n wec 100 * 6 10000 * 7 ? times data hold time * 8 t drp 10 ?? year programming wait time after swe1 bit setting * 1 t sswe 11 ? s wait time after psu1 bit setting * 1 t spsu 50 50 ? s t sp10 8 1012s t sp30 28 30 32 s 1 n 6 wait time after p1 bit setting * 1 * 4 t sp200 198 200 202 s 7 n 1000 wait time after p1 bit clear * 1 t cp 55 ? s wait time after psu1 bit clear * 1 t cpsu 55 ? s wait time after pv1 bit setting * 1 t spv 44 ? s wait time after h'ff dummy write * 1 t spvr 22 ? s wait time after pv1 bit clear * 1 t cpv 22 ? s wait time after swe1 bit clear t cswe 100 100 ? s n1 ?? 6 * 4 times maximum programming count * 1 * 4 n2 ?? 994 * 4
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 886 of 982 rej09b0054-0500 item symbol min typ max unit test conditions erase wait time after swe1 bit setting * 1 t sswe 11 ? s wait time after esu1 bit setting * 1 t sesu 100 100 ? s wait time after e1 bit setting * 1 * 5 t se 10 10 100 ms wait time after e1 bit clear * 1 t ce 10 10 ? s wait time after esu1 bit clear * 1 t cesu 10 10 ? s wait time after ev1 bit setting * 1 t sev 20 20 ? s wait time after h'ff dummy write * 1 t sevr 22 ? s wait time after ev1 bit clear * 1 t cev 44 ? s wait time after swe1 bit clear t cswe 100 100 ? s maximum erase count * 1 * 5 n ?? 100 times notes: 1. make each time setting in accordance with the program/program-verify flowchart or erase/erase-verify flowchart. 2. programming time per 128 bytes (shows the total period for which the p1 bit in the flash memory control register 1 (flmcr1) is set. it does not include the program verification time.) 3. block erase time (shows the total period for which the e1 bit in flmcr1 is set. it does not include the erase verification time.) 4. maximum programming time value t p (max) = wait time after p1 bit setting (t sp ) maximum program count (n) (t sp30 + t sp10 ) 6 + (t sp200 ) 994 5. relationship among the maximum erase time (t e (max)), the wait time after e1 bit setting (t se ), and the maximum erase count (n) is shown below. t e (max) = wait time after e1 bit setting (t se ) maximum erase count (n) 6. the minimum times that all characteristics after rewriting are guaranteed. (a range between 1 and minimum value is guaranteed.) 7. the reference value at 25 c. (normally, it is a reference that rewriting is enabled up to this value.) 8. data hold characteristics when rewriting is performed within the range of specifications including minimum value.
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 887 of 982 rej09b0054-0500 27.4 electrical characteristics of h8s/2238b and h8s/2236b 27.4.1 absolute maximum ratings table 27.26 lists the absolute maximum ratings. table 27.26 absolute maximum ratings item symbol value unit power supply voltage v cc ?0.3 to +7.0 v cv cc ?0.3 to +4.3 v input voltage (except ports 4 and 9) v in ?0.3 to v cc +0.3 v input voltage (ports 4 and 9) v in ?0.3 to av cc +0.3 v reference voltage v ref ?0.3 to av cc +0.3 v analog power supply voltage av cc ?0.3 to +7.0 v analog input voltage v an ?0.3 to av cc +0.3 v operating temperature t opr regular specifications: ?20 to +75 * c wide-range specifications: ?40 to +85 * c storage temperature t stg ?55 to +125 c caution: permanent damage to the chip may result if absolute maximum rating are exceeded. note: * the operating temperature ranges for flash memory programming/erasing are t a = ?20c to +75c.
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 888 of 982 rej09b0054-0500 27.4.2 dc characteristics table 27.27 lists the dc characteristics. table 27.28 lists the permissible output currents. table 27.29 lists the bus drive characteristics. table 27.27 dc characteristics (1) condition a (f-ztat version): v cc = 3.0 v to 5.5 v, av cc = 3.6 v to 5.5 v, v ref = 3.6 v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) * 1 condition b (masked rom version): v cc = 2.7 v to 5.5 v, av cc = 3.6 v to 5.5 v, v ref = 3.6 v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) * 1 item symbol min typ max unit test conditions irq7 to irq0 vt ? v cc 0.2 ?? v vt + ?? v cc 0.8 v vt + ? vt ? v cc 0.05 ?? vv cc = 4.0 v to 5.5 v schmitt trigger input voltage v cc 0.04 ?? vv cc = 2.7 v to 4.0 v input high voltage res , stby , nmi, md2 to md0, fwe v ih v cc 0.9 ? v cc + 0.3 v extal ports 1, 3, 7, a to g v cc 0.8 ? v cc + 0.3 v ports 4 and 9 v cc 0.8 ? av cc + 0.3 v input low voltage res , stby , md2 to md0, fwe v il ?0.3 ? v cc 0.1 v nmi, extal ports 1, 3, 4, 7, 9, a to g ?0.3 ? v cc 0.2 v output high voltage v oh v cc ? 0.5 ?? vi oh = ?200 a all output pins except p34 and p35 * 3 v cc ? 1.0 ?? vi oh = ?1 ma p34 and p35 * 2 v cc ? 2.7 ?? vi oh = ?100 a, v cc = 4.5 v to 5.5 v
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 889 of 982 rej09b0054-0500 item symbol min typ max unit test conditions v ol ?? 0.4 v i ol = 0.4 ma output low voltage all output pins * 3 ?? 0.4 v i ol = 0.8 ma res | i in | ?? 1.0 a input leakage current stby , nmi, md2 to md0, fwe ?? 1.0 a vin = 0.5 to v cc ? 0.5 v ports 4, 9 ?? 1.0 a v in = 0.5 to av cc ? 0.5 v three-state leakage current (off state) ports 1, 3, 7, a to g | i tsi | ?? 1.0 a v in = 0.5 to v cc ? 0.5 v input pull-up mos current ports a to e ?i p 10 ? 300 a v in = 0 v notes: 1. if the a/d and d/a converters are not used, do not leave the av cc , v ref , and av ss pins open. apply a voltage between 2.0 v and 5.5 v to the av cc and v ref pins by connecting them to v cc , for instance. set v ref av cc . 2. p35/sck1/scl0 and p34/sda0 are nmos push-pull outputs. in order to output a high level from scl0 and sda0 (ice = 1), a pull-up resistance must be connected externally. the high level of p35/sck1 and p34 (ice = 0) is driven by nmos. in order to output a high level, a pull-up resistance must be connected externally. 3. this is the case when iice = 0 and ice = 0. low-level output when the bus drive function is selected will be determined in table 27.29.
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 890 of 982 rej09b0054-0500 table 27.27 dc characteristics (2) condition a (f-ztat version): v cc = 3.0 v to 5.5 v, av cc = 3.6 v to 5.5 v, v ref = 3.6 v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) * 1 item symbol min typ max unit test conditions res c in ?? 30 pf input capacitance nmi ?? 30 pf p32 to p35 ?? 20 pf all input pins except the above ?? 15 pf vin = 0 v, f = 1 mhz, ta = 25c current dissipation * 2 normal operation i cc * 4 ? 23 v cc = 3.0 v 40 v cc = 5.5 v ma f = 13.5 mhz sleep mode ? 18 v cc = 3.0 v 30 v cc = 5.5 v ma f = 13.5 mhz all modules stopped ? 13 ? ma f = 13.5 mhz, v cc = 3.0 v (reference values) medium- speed mode ( /32) ? 13 ? ma f = 13.5 mhz, v cc = 3.0 v (reference values) subactive mode ? 80 180 a v cc = 3.0 v, when 32.768 khz crystal resonator is used subsleep mode ? 60 130 a v cc = 3.0 v, when 32.768 khz crystal resonator is used watch mode ? 840av cc = 3.0 v, when 32.768 khz crystal resonator is used
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 891 of 982 rej09b0054-0500 item symbol min typ max unit test conditions current dissipation * 2 standby mode * 3 i cc * 4 ? 1.0 v cc = 3.0 v 10 v cc = 5.5 v a t a 50c, when 32.768 khz crystal resonator is not used ?? 50 v cc = 5.5 v 50c < t a , when 32.768 khz crystal resonator is not used analog power supply current during a/d and d/a conversion al cc ? 0.3 1.5 ma idle ? 0.01 5.0 a reference current during a/d and d/a conversion al cc ? 1.3 3.5 ma idle ? 0.01 5.0 a ram standby voltage v ram 2.0 ?? v notes: 1. if the a/d and d/a converters are not used, do not leave the av cc , v ref , and av ss pins open. apply a voltage between 2.0 v and 5.5 v to the av cc and v ref pins by connecting them to v cc , for instance. set v ref av cc . 2. current dissipation values are for v ih min = v cc ? 0.5 v, v il max = 0.5 v with all output pins unloaded and the on-chip pull-up resistors in the off state. 3. the values are for v ram v cc < 3.0 v, v ih min = v cc 0.9, and v il max = 0.3 v. 4. i cc depends on v cc and f as follows: i cc max = 2.0 (ma) + 0.7 (ma/v) v cc + 1.4 (ma/mhz) f +0.20 (ma/(mhz v)) v cc f (normal operation) i cc max = 1.5 (ma) + 0.6 (ma/v) v cc + 1.1 (ma/mhz) f +0.15 (ma/(mhz v)) v cc f (sleep mode)
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 892 of 982 rej09b0054-0500 table 27.27 dc characteristics (3) condition b (masked rom version): v cc = 2.7 v to 5.5 v, av cc = 3.6 v to 5.5 v, v ref = 3.6 v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) * 1 item symbol min typ max unit test conditions res c in ?? 30 pf input capacitance nmi ?? 30 pf p32 to p35 ?? 20 pf all input pins except the above ?? 15 pf vin = 0 v, f = 1 mhz, ta = 25c current dissipation * 2 normal operation i cc * 4 ? 22 v cc = 3.0 v 40 v cc = 5.5 v ma f = 13.5 mhz sleep mode ? 16 v cc = 3.0 v 30 v cc = 5.5 v ma f = 13.5 mhz all modules stopped ? 13 ? ma f = 13.5 mhz, v cc = 3.0 v (reference values) medium- speed mode ( /32) ? 13 ? ma f = 13.5 mhz, v cc = 3.0 v (reference values) subactive mode ? 60 180 a v cc = 3.0 v, when 32.768 khz crystal resonator is used subsleep mode ? 35 100 a v cc = 3.0 v, when 32.768 khz crystal resonator is used watch mode ? 840av cc = 3.0 v, when 32.768 khz crystal resonator is used standby mode * 3 ? 0.5 v cc = 3.0 v 10 v cc = 5.5 v a t a 50c, when 32.768 khz crystal resonator is not used ?? 50 v cc = 5.5 v 50c < t a , when 32.768 khz crystal resonator is not used
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 893 of 982 rej09b0054-0500 item symbol min typ max unit test conditions analog power supply current during a/d and d/a conversion al cc ? 0.3 1.5 ma idle ? 0.01 5.0 a reference current during a/d and d/a conversion al cc ? 1.3 3.5 ma idle ? 0.01 5.0 a ram standby voltage v ram 2.0 ?? v notes: 1. if the a/d and d/a converters are not used, do not leave the av cc , v ref , and av ss pins open. apply a voltage between 2.0 v and 5.5 v to the av cc and v ref pins by connecting them to v cc , for instance. set v ref av cc . 2. current dissipation values are for v ih min = v cc ? 0.5 v, v il max = 0.5 v with all output pins unloaded and the on-chip pull-up resistors in the off state. 3. the values are for v ram v cc < 2.7 v, v ih min = v cc 0.9, and v il max = 0.3 v. 4. i cc depends on v cc and f as follows: i cc max = 2.0 (ma) + 0.7 (ma/v) v cc + 1.4 (ma/mhz) f + 0.20 (ma/(mhz v)) v cc f (normal mode) i cc max = 1.5 (ma) + 0.6 (ma/v) v cc + 1.1 (ma/mhz) f + 0.15 (ma/(mhz v)) v cc f (sleep mode)
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 894 of 982 rej09b0054-0500 table 27.28 permissible output currents condition a (f-ztat version): v cc = 3.0 v to 5.5 v, av cc = 3.6 v to 5.5 v, v ref = 3.6 v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition b (masked rom version): v cc = 2.7 v to 5.5 v, av cc = 3.6 v to 5.5 v, v ref = 3.6 v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) item symbol min typ max unit permissible output low current (per pin) scl1, scl0, sda1, sda0 i ol ?? 10 ma all output pins except the above ?? 1.0 permissible output low current (total) total of all output pins i ol ?? 60 ma permissible output high current (per pin) all output pins ?i oh ?? 1.0 ma permissible output high current (total) total of all output pins ?i oh ?? 30 ma note: to protect chip reliability, do not exceed the output current values in table 27.28.
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 895 of 982 rej09b0054-0500 table 27.29 bus drive characteristics condition a (f-ztat version): v cc = 3.0 v to 5.5 v, av cc = 3.6 v to 5.5 v, v ref = 3.6 v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications)* condition b (masked rom version): v cc = 2.7 v to 5.5 v, av cc = 3.6 v to 5.5 v, v ref = 3.6 v to av cc , v ss = av ss = 0 v, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications)* applicable pins: scl1 and scl0, sda1 and sda0 item symbol min typ max unit test conditions vt ? v cc 0.3 ?? v cc = 2.7 v to 5.5 v vt + ?? v cc 0.7 v cc = 2.7 v to 5.5 v 0.4 ?? v cc = 4.0 v to 5.5 v schmitt trigger input voltage vt + ? vt ? v cc 0.05 ?? v v cc = 2.7 v to 4.0 v input high voltage v ih v cc 0.7 ? v cc + 0.5 v v cc = 2.7 v to 5.5 v input low voltage v il ?0.5 ? v cc 0.3 v v cc = 2.7 v to 5.5 v ?? 0.5 i ol = 8 ma, v cc = 4.0 v to 5.5 v output low voltage v ol ?? 0.4 v i ol = 3 ma input capacitance c in ?? 20 pf v in = 0 v, f = 1 mhz, t a = 25 c three-state leakage current (off state) | i tsi | ?? 1.0 a v in = 0.5 to v cc ? 0.5 v scl, sda output fall time t of 20 + 0.1 cb ? 250 ns v cc = 2.7 v to 5.5 v note: * if the a/d and d/a converters are not used, do not leave the av cc , v ref , and av ss pins open. apply a voltage between 2.0 v and 5.5 v to the av cc and v ref pins by connecting them to v cc , for instance. set v ref av cc .
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 896 of 982 rej09b0054-0500 27.4.3 ac characteristics figure 27.9 shows the test conditions for the ac characteristics. 3 v r l r h c lsi output pin c = 30 pf r l = 2.4 k ? r h = 12 k ? input/output timing measurement levels  low level: 0.8 v  high level: 2.0 v figure 27.9 output load circuit
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 897 of 982 rej09b0054-0500 (1) clock timing table 27.30 lists the clock timing table 27.30 clock timing condition a (f-ztat version): v cc = 3.0 v to 5.5 v, av cc = 3.6 v to 5.5 v, v ref = 3.6 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 mhz to 13.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition b (masked rom version): v cc = 2.7 v to 5.5 v, av cc = 3.6 v to 5.5 v, v ref = 3.6 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 mhz to 13.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) conditions a, b item symbol min typ max unit test conditions clock cycle time t cyc 74 ? 500 ns clock high pulse width t ch 25 ?? ns clock low pulse width t cl 25 ?? ns clock rise time t cr ?? 10 ns clock fall time t cf ?? 10 ns figure 27.10 reset oscillation stabilization time (crystal) t osc1 20 ?? ms figure 27.11 software standby oscillation stabilization time (crystal) t osc2 8 ?? ms external clock output stabilization delay time t dext 500 ?? s figure 27.11 subclock oscillation stabilization time t osc3 ?? 2s subclock oscillator frequency f sub ? 32.768 ? khz subclock ( sub ) cycle time t sub ? 30.5 ? s
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 898 of 982 rej09b0054-0500 (2) control signal timing table 27.31 lists the control signal timing. table 27.31 control signal timing condition a (f-ztat version): v cc = 3.0 v to 5.5 v, av cc = 3.6 v to 5.5 v, v ref = 3.6 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 mhz to 13.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition b (masked rom version): v cc = 2.7 v to 5.5 v, av cc = 3.6 v to 5.5 v, v ref = 3.6 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 mhz to 13.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) conditions a, b item symbol min max unit test conditions res setup time t ress 250 ? ns figure 27.12 res pulse width t resw 20 ? t cyc mres setup time t mress 250 ? ns mres pulse width t mresw 20 ? t cyc nmi setup time t nmis 250 ? ns figure 27.13 nmi hold time t nmih 10 ? nmi pulse width (exiting software standby mode) t nmiw 200 ? ns irq setup time t irqs 250 ? ns irq hold time t irqh 10 ? ns irq pulse width (exiting software standby mode) t irqw 200 ? ns
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 899 of 982 rej09b0054-0500 (3) bus timing table 27.32 lists the bus timing. table 27.32 bus timing condition a (f-ztat version): v cc = 3.0 v to 5.5 v, av cc = 3.6 v to 5.5 v, v ref = 3.6 v to av cc , v ss = av ss = 0 v, = 2 mhz to 13.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition b (masked rom version): v cc = 2.7 v to 5.5 v, av cc = 3.6 v to 5.5 v, v ref = 3.6 v to av cc , v ss = av ss = 0 v, = 2 mhz to 13.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) conditions a, b item symbol min max unit test conditions address delay time t ad ? 50 ns address setup time t as 0.5 t cyc ? 30 ? ns address hold time t ah 0.5 t cyc ? 15 ? ns cs delay time t csd ? 50 ns figures 27.14 to 27.18 as delay time t asd ? 50 ns rd delay time 1 t rsd1 ? 50 ns rd delay time 2 t rsd2 ? 50 ns read data setup time t rds 30 ? ns read data hold time t rdh 0 ? ns read data access time 1 t acc1 ? 1.0 t cyc ? 65 ns read data access time 2 t acc2 ? 1.5 t cyc ? 65 ns read data access time 3 t acc3 ? 2.0 t cyc ? 65 ns read data access time 4 t acc4 ? 2.5 t cyc ? 65 ns read data access time 5 t acc5 ? 3.0 t cyc ? 65 ns
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 900 of 982 rej09b0054-0500 conditions a, b item symbol min max unit test conditions wr delay time 1 t wrd1 ? 50 ns wr delay time 2 t wrd2 ? 50 ns wr pulse width 1 t wsw1 1.0 t cyc ? 30 ? ns wr pulse width 2 t wsw2 1.5 t cyc ? 30 ? ns write data delay time t wdd ? 70 ns write data setup time t wds 0.5 t cyc ? 37 ? ns write data hold time t wdh 0.5 t cyc ? 15 ? ns figures 27.14 to 27.18 wait setup time t wts 50 ? ns wait hold time t wth 10 ? ns figure 27.16 breq setup time t brqs 50 ? ns figure 27.19 back delay time t bacd ? 50 ns bus-floating time t bzd ? 80 ns
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 901 of 982 rej09b0054-0500 (4) timing of on-chip peripheral modules table 27.33 shows the timing of on-chip peripheral modules, and table 27.34 shows the i 2 c bus timing. table 27.33 timing of on-chip peripheral modules condition a (f-ztat version): v cc = 3.0 v to 5.5 v, av cc = 3.6 v to 5.5 v, v ref = 3.6 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 mhz to 13.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition b (masked rom version): v cc = 2.7 v to 5.5 v, av cc = 3.6 v to 5.5 v, v ref = 3.6 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 mhz to 13.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) conditions a, b item symbol min max unit test conditions i/o port * output data delay time t pwd ? 100 ns figure 27.24 input data setup time t prs 50 ? input data hold time t prh 50 ? tpu timer output delay time t tocd ? 100 ns figure 27.25 timer input setup time t tics 40 ? timer clock input setup time t tcks 40 ? ns figure 27.26 single edge t tckwh 1.5 ? t cyc timer clock pulse width both edges t tckwl 2.5 ? tmr timer output delay time t tmod ? 100 ns figure 27.27 timer reset input setup time t tmrs 50 ? ns figure 27.29 timer clock input setup time t tmcs 50 ? ns figure 27.28 single edge t tmcwh 1.5 ? t cyc timer clock pulse width both edges t tmcwl 2.5 ?
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 902 of 982 rej09b0054-0500 conditions a, b item symbol min max unit test conditions wdt1 buzz output delay time t buzd ? 100 ns figure 27.30 sci * asynchronous t scyc 4 ? t cyc figure 27.31 input clock cycle synchronous 6 ? input clock pulse width t sckw 0.4 0.6 t scyc input clock rise time t sckr ? 1.5 t cyc input clock fall time t sckf ? 1.5 transmit data delay time t txd ? 100 ns figure 27.32 receive data setup time (synchronous) t rxs 75 ? ns receive data hold time (synchronous) t rxh 75 ? ns a/d converter trigger input setup time t trgs 40 ? ns figure 27.33 note: * the high level of p35/sck1 and p34 is driven by nmos. in order to output a high level at v cc = 4.5 v or below, a pull-up resistance must be connected externally.
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 903 of 982 rej09b0054-0500 table 27.34 i 2 c bus timing condition a (f-ztat version): v cc = 3.0 v to 5.5 v, v ss = 0 v, = 5 mhz to maximum operating frequency, t a = ?20c to +75c condition b (masked rom version): v cc = 2.7 v to 5.5 v, v ss = 0 v, = 5 mhz to maximum operating frequency, t a = ?20c to +75c conditions a, b item symbol min typ max unit test conditions scl input cycle time t scl 12 t cyc ?? ns figure 27.34 scl input high pulse width t sclh 3 t cyc ?? ns scl input low pulse width t scll 5 t cyc ?? ns scl, sda input rise time t sr ?? 7.5 t cyc * ns scl, sda input fall time t sf ?? 300 ns scl, sda input spike pulse elimination time t sp ?? 1 t cyc ns sda input bus free time t buf 5 t cyc ?? ns start condition input hold time t stah 3 t cyc ?? ns retransmission start condition input setup time t stas 3 t cyc ?? ns stop condition input setup time t stos 3 t cyc ?? ns data input setup time t sdas 0.5 t cyc ?? ns data input hold time t sdah 0 ?? ns scl, sda capacitive load c b ?? 400 pf note: * 7.5 t cyc and 17.5 t cyc can be set according to the clock selected for use by the i 2 c module. for details, see section 16.6, usage notes.
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 904 of 982 rej09b0054-0500 27.4.4 a/d conversion characteristics a/d converter characteristics for the f-ztat and masked rom versions are shown in table 27.35. table 27.35 a/d conversion characteristics (f-ztat and masked rom versions) condition: v cc = 3.0 v to 5.5 v, av cc = 3.6 v to 5.5 v, v ref = 3.6 v to av cc , v ss = av ss = 0 v, = 2 mhz to 13.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition item min typ max unit resolution 10 10 10 bit conversion time 9.6 ?? s analog input capacitance ?? 20 pf permissible signal-source impedance ?? 5k ? nonlinearity error ?? 6.0 lsb offset error ?? 4.0 lsb full-scale error ?? 4.0 lsb quantization ?? 0.5 lsb absolute accuracy ?? 8.0 lsb 27.4.5 d/a conversion characteristics table 27.36 lists the d/a conversion characteristics. table 27.36 d/a conversion characteristics (f-ztat and masked rom versions) condition: v cc = 3.0 v to 5.5 v, av cc = 3.6 v to 5.5 v, v ref = 3.6 v to av cc , v ss = av ss = 0 v, = 2 mhz to 13.5 mhz, t a = ?20c to +75c (regular specifications), t a = ?40c to +85c (wide-range specifications) condition item min typ max unit test conditions resolution 8 8 8 bit conversion time ?? 10 s 20-pf capacitive load absolute accuracy ? 2.0 3.0 lsb 2-m ? resistive load ?? 2.0 lsb 4-m ? resistive load
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 905 of 982 rej09b0054-0500 27.4.6 flash memory characteristics table 27.37 lists the flash memory characteristics. table 27.37 flash memory characteristics conditions: v cc = 3.0 v to 5.5 v, av cc = 3.0 v to 5.5 v, v ref = 3.0 v to av cc , v ss = av ss = 0 v, t a = -20c to +75c (program/erase operating temperature range; regular specifications), t a = ?20c to +75c (program/erase operating temperature range; wide-range specifications) item symbol min typ max unit test conditions programming time * 1 * 2 * 4 t p ? 10 200 ms/ 128 bytes erase time * 1 * 3 * 5 t e ? 100 1200 ms/block rewrite times n wec 100 * 6 10000 * 7 ? times data holding time * 8 t drp 10 ?? years programming wait time after swe1 bit setting * 1 t sswe 11 ? s wait time after psu1 bit setting * 1 t spsu 50 50 ? s wait time after p1 bit setting * 1 * 4 t sp10 81012s t sp30 28 30 32 s1 n 6 t sp200 198 200 202 s7 n 1000 wait time after p1 bit clearing * 1 t cp 55 ? s wait time after psu1 bit clearing * 1 t cpsu 55 ? s wait time after pv1 bit setting * 1 t spv 44 ? s wait time after h'ff dummy write * 1 t spvr 22 ? s wait time after pv1 bit clearing * 1 t cpv 22 ? s wait time after swe1 bit clearing t cswe 100 100 ? s n1 ?? 6 * 4 times maximum number of programming operations * 1 * 4 n2 ?? 994 * 4 erasing wait time after swe1 bit setting * 1 t sswe 11 ? s wait time after esu1 bit setting * 1 t sesu 100 100 ? s wait time after e1 bit setting * 1 * 5 t se 10 10 100 ms wait time after e1 bit clearing * 1 t ce 10 10 ? s wait time after esu1 bit clearing * 1 t cesu 10 10 ? s wait time after ev1 bit setting * 1 t sev 20 20 ? s wait time after h'ff dummy write * 1 t sevr 22 ? s wait time after ev1 bit clearing * 1 t cev 44 ? s
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 906 of 982 rej09b0054-0500 item symbol min typ max unit test conditions erasing wait time after swe1 bit clearing t cswe 100 100 ? s maximum number of erases * 1 * 5 n ?? 100 times notes: 1. follow the program/erase algorithms when making the time settings. 2. programming time per 128 bytes (indicates the total time during which the p1 bit is set in flash memory control register 1 (flmcr1). does not include the program-verify time.) 3. time to erase one block (indicates the time during which the e1 bit is set in flmcr1. does not include the erase-verify time.) 4. maximum programming time (t p (max) = wait time after p1 bit setting (t sp ) maximum number of writes (n)) (t sp30 + t sp10 ) 6 + (t sp200 ) 994 5. for the maximum erase time (t e (max)), the following relationship applies between the wait time after e1 bit setting (z) and the maximum number of erases (n): t e (max) = wait time after e1 bit setting (t se ) maximum number of erases (n) 6. the minimum times that all characteristics after rewriting are guaranteed. (a range between 1 and minimum value is guaranteed.) 7. the reference value at 25 c. (normally, it is a reference that rewriting is enabled up to this value.) 8. data hold characteristics when rewriting is performed within the range of specifications including minimum value.
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 907 of 982 rej09b0054-0500 27.5 electrical characteristics of h8s/2238r and h8s/2236r 27.5.1 absolute maximum ratings table 27.38 lists the absolute maximum ratings. table 27.38 absolute maximum ratings item symbol value unit v cc ?0.3 to +4.3 v power supply voltage cv cc ?0.3 to +4.3 v input voltage (except ports 4 and 9) v in ?0.3 to v cc +0.3 v input voltage (ports 4 and 9) v in ?0.3 to av cc +0.3 v reference power supply voltage v ref ?0.3 to av cc +0.3 v analog power supply voltage av cc ?0.3 to +4.3 v analog input voltage v an ?0.3 to av cc +0.3 v operating temperature t opr regular specifications: ?20 to +75 * 1 wide-range specifications: ?40 to +85 * 2 c storage temperature t stg ?55 to +125 c caution: permanent damage to the chip may result if absolute maximum rating are exceeded. notes: 1. when the operating voltage in read is v cc = 2.7 v to 3.6 v, the operating temperature ranges for flash memory programming/erasing are t a = ?20 c to +75 c. when the operating voltage in read is v cc = 2.2 v to 3.6 v, the operating temperature ranges for flash memory programming/erasing are t a = ?20 c to +50 c. 2. the operating temperature ranges for flash memory programming/erasing are t a = ?40 c to +80 c (regular specifications).
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 908 of 982 rej09b0054-0500 27.5.2 dc characteristics table 27.39 lists the dc characteristics. table 27.40 lists the permissible output currents. table 27.41 lists the bus driving characteristics. table 27.39 dc characteristics (1) condition a (f-ztat version): v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss =av ss = 0 v, t a = ?20 c to +75 c (regular specifications) t a = ?40 c to +85 c (wide-range specifications) * 1 condition b (f-ztat version): v cc = 2.2 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss =av ss = 0 v, t a = ?20 c to +75 c (regular specifications) condition c (masked rom version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss = av ss = 0 v, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) * 1 item symbol min typ max unit test conditions irq0 to irq7 vt ? v cc 0.2 ?? v vt + ?? v cc 0.8 v schmitt trigger input voltage vt + ? vt ? v cc 0.05 ?? v input high voltage res , stby , nmi, fwe, md2 to md0 v ih v cc 0.9 ? v cc + 0.3 v extal, ports 1, 3, 7, and a to g v cc 0.8 ? v cc + 0.3 v ports 4 and 9 v cc 0.8 ? av cc + 0.3 v input low voltage res , stby , fwe, md2 to md0 v il ?0.3 ? v cc 0.1 v nmi, extal, ports 1, 3, 4, 7, 9, and a to g ?0.3 ? v cc 0.2 v
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 909 of 982 rej09b0054-0500 item symbol min typ max unit test conditions v oh v cc ? 0.5 ?? vi oh = ?200 a output high voltage all output pins * 4 except p34 and p35 v cc ? 1.0 ?? vi oh = ?1 ma * 2 p34 and p35 * 3 v cc ? 2.0 ?? vi oh = ?100 a (reference value) all output pins * 4 v ol ?? 0.4 v i ol = 0.4 ma output low voltage ?? 0.4 v i ol = 0.8 ma * 2 res ?? 1.0 a input leakage current stby , nmi, fwe, md2 to md0 ?? 1.0 a v in = 0.2 to v cc ? 0.2 v ports 4, 9 | i in | ?? 1.0 a v in = 0.2 to av cc ? 0.2 v three states leakage current (off) ports 1, 3, 7, and a to g | i tsi | ?? 1.0 a v in = 0.2 to v cc ? 0.2 v input pull-up mos current ports a to e ?i p 10 ? 300 a v in = 0v notes: 1. if the a/d or d/a converter is not used, the av cc , v ref , and av ss pins should not be open. even if the a/d or d/a converter is not used, connect the av cc and v ref pins to v cc and supply 2.0 v to 3.6 v. in this case, v ref av cc . 2. v cc = 2.7 v to 3.6 v 3. p35/sck1 and p34 function as nmos push-pull output. to output the high voltage, connect an external pull-up resistor. 4. in the case when ice = 0. low voltage output with bus driving function is specified in table 27.41.
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 910 of 982 rej09b0054-0500 table 27.39 dc characteristics (2) condition a (f-ztat version): v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss =av ss = 0 v, t a = ?20 c to +75 c (regular specifications) t a = ?40 c to +85 c (wide-range specifications) * 1 condition b (f-ztat version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss =av ss = 0 v, t a = ?20 c to +75 c (regular specifications) item symbol min typ max unit test conditions res ?? 30 pf nmi ?? 30 pf p32 to p35 ?? 20 pf input capacitance all input pins other than above ones c in ?? 15 pf v in = 0 v, f = 1 mhz, t a = 25 c current consumption * 2 normal operation i cc * 4 ? 20 v cc = 3.0 v 37 v cc = 3.6 v ma f = 13.5 mhz ? 10 v cc = 3.0 v 18 v cc = 3.6 v ma f = 6.25 mhz sleep mode ? 15 v cc = 3.0 v 29 v cc = 3.6 v ma f = 13.5 mhz ? 7.5 v cc = 3.0 v 14 v cc = 3.6 v ma f = 6.25 mhz all modules stopped ? 15 ? ma f = 13.5 mhz, v cc = 3.0 v (reference value) medium- speed mode ( /32) ? 13 ? ma f = 13.5 mhz, v cc = 3.0 v (reference value) subactive mode ? 70 180 a v cc = 3.0 v, when 32.768 khz crystal resonator is used subsleep mode ? 50 130 a v cc = 3.0 v, when 32.768 khz crystal resonator is used
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 911 of 982 rej09b0054-0500 item symbol min typ max unit test conditions current consumption * 2 watch mode i cc * 4 ? 840av cc = 3.0 v, when 32.768 khz crystal resonator is used ? 1.0 v cc = 3.0 v 10 v cc = 3.6 v a t a 50 c, when 32.768 khz crystal resonator is not used standby mode * 3 ?? 50 v cc = 3.6 v a 50 c < t a , when 32.768 khz crystal resonator is not used during a/d conversion al cc ? 0.5 1.5 ma analog power supply current idle ? 0.01 5.0 a during a/d conversion al cc ? 1.3 2.5 ma reference power supply current idle ? 0.01 5.0 a ram standby voltage v ram 2.0 ?? v notes: 1. if the a/d or d/a converter is not used, the av cc , v ref , and av ss pins should not be open. even if the a/d or d/a converter is not used, connect the av cc and v ref pins to v cc and supply 2.0 v to 3.6 v. in this case, v ref av cc . 2. current consumption values are for v ih min = v cc ? 0.2 v and v il max = 0.2 v, with all output pins unloaded and the on-chip mos pull-up transistors in the off state. 3. the values are for v ram v cc < 2.2 v, v ih min = v cc ? 0.2, and v il max = 0.2 v. 4. i cc depends on v cc and f as follows: i cc max = 1.0 (ma) + 0.74 (ma/(mhz v)) v cc f (normal operation) i cc max = 1.0 (ma) + 0.58 (ma/(mhz v)) v cc f (sleep mode)
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 912 of 982 rej09b0054-0500 table 27.39 dc characteristics (3) condition c (masked rom version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss = av ss = 0 v, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) * 1 item symbol min typ max unit test conditions res ?? 30 pf nmi ?? 30 pf p32 to p35 ?? 20 pf input capacitance all input pins other than above ones c in ?? 15 pf v in = 0 v, f = 1 mhz, t a = 25 c ? 20 v cc = 3.0 v 37 v cc = 3.6 v ma f = 13.5 mhz current consumption * 2 normal operation i cc * 4 ? 10 v cc = 3.0 v 18 v cc = 3.6 v ma f = 6.25 mhz ? 15 v cc = 3.0 v 29 v cc = 3.6 v ma f = 13.5 mhz sleep mode ? 7.5 v cc = 3.0 v 14 v cc = 3.6 v ma f = 6.25 mhz all modules stopped ? 15 ? ma f = 13.5 mhz, v cc = 3.0 v (reference value) medium- speed mode ( /32) ? 13 ? ma f = 13.5 mhz, v cc = 3.0 v (reference value) subactive mode ? 45 180 a v cc = 3.0 v, when 32.768 khz crystal resonator is used
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 913 of 982 rej09b0054-0500 item symbol min typ max unit test conditions current consumption * 2 subsleep mode i cc * 4 ? 30 100 a v cc = 3.0 v, when 32.768 khz crystal resonator is used watch mode ? 840av cc = 3.0 v, when 32.768 khz crystal resonator is used ? 0.5 v cc = 3.0 v 10 v cc = 3.6 v a t a 50c, when 32.768 khz crystal resonator is not used standby mode * 3 ?? 50 v cc = 3.6 v a 50c < t a , when 32.768 khz crystal resonator is not used during a/d conversion al cc ? 0.5 1.5 ma analog power supply current idle ? 0.01 5.0 a during a/d conversion al cc ? 1.3 2.5 ma reference power supply current idle ? 0.01 5.0 a ram standby voltage v ram 2.0 ?? v notes: 1. if the a/d or d/a converter is not used, the av cc , v ref , and av ss pins should not be open. even if the a/d or d/a converter is not used, connect the av cc and v ref pins to v cc and supply 2.0 v to 3.6 v. in this case, v ref av cc . 2. current consumption values are for v ih min = v cc ? 0.2 v and v il max = 0.2 v, with all output pins unloaded and the on-chip mos pull-up transistors in the off state. 3. the values are for v ram v cc < 2.2 v, v ih min = v cc ? 0.2, and v il max = 0.2 v. 4. i cc depends on v cc and f as follows: i cc max = 1.0 (ma) + 0.74 (ma/(mhz v)) v cc f (normal operation) i cc max = 1.0 (ma) + 0.58 (ma/(mhz v)) v cc f (sleep mode)
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 914 of 982 rej09b0054-0500 table 27.40 permissible output currents condition a (f-ztat version): v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss =av ss = 0 v, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition b (f-ztat version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss =av ss = 0 v, t a = ?20 c to +75 c (regular specifications) condition c (masked rom version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss = av ss = 0 v, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) item symbol min typ max unit scl1, scl0, sda1, sda0 v cc = 2.7 v to 3.6 v i ol ?? 10 v cc = 2.2 v to 3.6 v ?? 0.5 permissible output low current (per pin) output pins other than above ones v cc = 2.7 v to 3.6 v i ol ?? 1.0 ma v cc = 2.2 v to 3.6 v ?? 30 permissible output low current (total) total of all output pins v cc = 2.7 v to 3.6 v i ol ?? 60 ma v cc = 2.2 v to 3.6 v ?? 0.5 permissible output high current (per pin) all output pins v cc = 2.7 v to 3.6 v ?i oh ?? 1.0 ma v cc = 2.2 v to 3.6 v ?? 15 permissible output high current (total) total of all output pins v cc = 2.7 v to 3.6 v ?i oh ?? 30 ma note: to protect chip reliability, do not exceed the output current values in table 27.40.
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 915 of 982 rej09b0054-0500 table 27.41 bus driving characteristics conditions: v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications)*, objective pins: scl1 and 0 and sda1 and 0 item symbol min typ max unit test conditions vt ? v cc 0.3 ?? vv cc = 2.7 v to 3.6 v vt + ?? v cc 0.7 v v cc = 2.7 v to 3.6 v schmitt trigger input voltage vt + ? vt ? v cc 0.05 ?? vv cc = 2.7 v to 3.6 v input high voltage v ih v cc 0.7 ? v cc + 0.5 v v cc = 2.7 v to 3.6 v input low voltage v il ?0.5 ? v cc 0.3 v v cc = 2.7 v to 3.6 v v ol ?? 0.5 v i ol = 6 ma, v cc = 3.0 v to 3.6 v output low voltage ?? 0.4 v i ol = 3 ma input capacitance c in ?? 20 pf v in = 0 v f = 1 mhz t a = 25 c three states leakage current (off) | i tsi | ?? 1.0 a v in = 0.5 v to v cc ? 0.5 v scl, sda output falling time t of 20 + 0.1 cb ? 250 ns v cc = 2.7 v to 3.6 v note: * if the a/d or d/a converter is not used, the av cc , v ref , and av ss pins should not be open. even if the a/d or d/a converter is not used, connect the av cc and v ref pins to v cc and supply 2.0 v to 3.6 v. in this case, v ref av cc . 27.5.3 ac characteristics figure 27.8 shows the test conditions for the ac characteristics. (1) clock timing table 27.42 lists the clock timing.
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 916 of 982 rej09b0054-0500 table 27.42 clock timing condition a (f-ztat version and masked rom version): v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss =av ss = 0 v, = 32.768 khz, 2 to 13.5 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition b (f-ztat version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss =av ss = 0 v, = 32.768 khz, 2 to 6.25 mhz, t a = ?20 c to +75 c (regular specifications) condition c (masked rom version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 to 6.25 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition a conditions b, c item symbol min typ max min typ max unit test conditions clock cycle time t cyc 74 ? 500 160 ? 500 ns clock high pulse width t ch 25 ?? 50 ?? ns clock low pulse width t cl 25 ?? 50 ?? ns clock rise time t cr ?? 10 ?? 25 ns clock fall time t cf ?? 10 ?? 25 ns figure 27.10 oscillation stabilization time at reset (crystal) t osc1 20 ?? 40 ?? ms figure 27.11 oscillation stabilization time in software standby (crystal) t osc2 8 ?? 16 ?? ms external clock output stabilization delay time t dext 500 ?? 1000 ?? s figure 27.11 subclock oscillation stabilization time t osc3 ?? 2 ?? 4s subclock oscillator frequency f sub ? 32.768 ?? 32.768 ? khz subclock ( sub ) cycle time t sub ? 30.5 ?? 30.5 ? s
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 917 of 982 rej09b0054-0500 (2) control signal timing table 27.43 lists the control signal timing. table 27.43 control signal timing condition a (f-ztat version and masked rom version): v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss =av ss = 0 v, = 32.768 khz, 2 to 13.5 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition b (f-ztat version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss =av ss = 0 v, = 32.768 khz, 2 to 6.25 mhz, t a = ?20 c to +75 c (regular specifications) condition c (masked rom version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 to 6.25 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition a conditions b, c item symbol min max min max unit test conditions res setup time t ress 250 ? 350 ? ns figure 27.12 res pulse width t resw 20 ? 20 ? t cyc mres setup time t mress 250 ? 350 ? ns mres pulse width t mresw 20 ? 20 ? t cyc nmi setup time t nmis 250 ? 350 ? ns figure 27.13 nmi hold time t nmih 10 ? 10 ? ns nmi pulse width (exiting software standby mode) t nmiw 200 ? 300 ? ns irq setup time t irqs 250 ? 350 ? ns irq hold time t irqh 10 ? 10 ? ns irq pulse width (exiting software standby mode) t irqw 200 ? 300 ? ns
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 918 of 982 rej09b0054-0500 (3) bus timing table 27.44 lists the bus timing. table 27.44 bus timing condition a (f-ztat version and masked rom version): v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss =av ss = 0 v, = 2 to 13.5 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition b (f-ztat version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss =av ss = 0 v, = 2 to 6.25 mhz, t a = ?20 c to +75 c (regular specifications) condition c (masked rom version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss = av ss = 0 v, = 2 to 6.25 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition a conditions b, c test item symbol min max min max unit conditions address delay time t ad ? 50 ? 90 ns address setup time t as 0.5 t cyc ? 30 ? 0.5 t cyc ? 60 ? ns address hold time t ah 0.5 t cyc ? 15 ? 0.5 t cyc ? 30 ? ns figures 27.14 to 27.18 cs delay time t csd ? 50 ? 90 ns as delay time t asd ? 50 ? 90 ns rd delay time 1 t rsd1 ? 50 ? 90 ns rd delay time 2 t rsd2 ? 50 ? 90 ns read data setup time t rds 30 ? 50 ? ns read data hold time t rdh 0 ? 0 ? ns read data access time 1 t acc1 ? 1.0 t cyc ? 65 ? 1.0 t cyc ? 90 ns
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 919 of 982 rej09b0054-0500 condition a conditions b, c test item symbol min max min max unit conditions read data access time 2 t acc2 ? 1.5 t cyc ? 65 ? 1.5 t cyc ? 90 ns read data access time 3 t acc3 ? 2.0 t cyc ? 65 ? 2.0 t cyc ? 90 ns read data access time 4 t acc4 ? 2.5 t cyc ? 65 ? 2.5 t cyc ? 90 ns figures 27.14 to 27.18 read data access time 5 t acc5 ? 3.0 t cyc ? 65 ? 3.0 t cyc ? 90 ns wr delay time 1 t wrd1 ? 50 ? 90 ns wr delay time 2 t wrd2 ? 50 ? 90 ns wr pulse width 1 t wsw1 1.0 t cyc ? 30 ? 1.0 t cyc ? 60 ? ns wr pulse width 2 t wsw2 1.5 t cyc ? 30 ? 1.5 t cyc ? 60 ? ns write data delay time t wdd ? 70 ? 100 ns write data setup time t wds 0.5 t cyc ? 37 ? 0.5 t cyc ? 80 ? ns write data hold time t wdh 0.5 t cyc ? 15 ? 0.5 t cyc ? 60 ? ns wait setup time t wts 50 ? 90 ? ns wait hold time t wth 10 ? 10 ? ns figure 27.16 breq setup time t brqs 50 ? 90 ? ns back delay time t bacd ? 50 ? 90 ns bus-floating time t bzd ? 80 ? 160 ns figure 27.19
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 920 of 982 rej09b0054-0500 (4) timing of on-chip peripheral modules table 27.45 lists the timing of on-chip peripheral modules. table 27.46 lists the i 2 c bus timing. table 27.45 timing of on-chip peripheral modules condition a (f-ztat version and masked rom version): v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss =av ss = 0 v, = 32.768 khz, 2 to 13.5 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition b (f-ztat version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss =av ss = 0 v, = 32.768 khz, 2 to 6.25 mhz, t a = ?20 c to +75 c (regular specifications) condition c (masked rom version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 to 6.25 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition a conditions b, c item symbol min max min max unit test conditions i/o port * output data delay time t pwd ? 100 ? 150 ns figure 27.24 input data setup time t prs 50 ? 80 ? input data hold time t prh 50 ? 80 ? tpu timer output delay time t tocd ? 100 ? 150 ns figure 27.25 timer input setup time t tics 40 ? 60 ? timer clock input setup time t tcks 40 ? 60 ? ns figure 27.26 single edge t tckwh 1.5 ? 1.5 ? t cyc timer clock pulse width both edges t tckwl 2.5 ? 2.5 ? tmr timer output delay time t tmod ? 100 ? 150 ns figure 27.27 timer reset input setup time t tmrs 50 ? 80 ? ns figure 27.29 timer clock input setup time t tmcs 50 ? 80 ? ns figure 27.28
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 921 of 982 rej09b0054-0500 condition a conditions b, c item symbol min max min max unit test conditions tmr single edge t tmcwh 1.5 ? 1.5 ? t cyc figure 27.28 timer clock pulse width both edges t tmcwl 2.5 ? 2.5 ? wdt_1 buzz output delay time t buzd ? 100 ? 150 ns figure 27.30 sci * asynchro- nous t scyc 4 ? 4 ? t cyc figure 27.31 input clock cycle synchro- nous 6 ? 6 ? input clock pulse width t sckw 0.4 0.6 0.4 0.6 t scyc input clock rise time t sckr ? 1.5 ? 1.5 t cyc input clock fall time t sckf ? 1.5 ? 1.5 transmit data delay time t txd ? 100 ? 150 ns figure 27.32 receive data setup time (synchronous) t rxs 75 ? 150 ? ns receive data hold time (synchronous) t rxh 75 ? 150 ? ns a/d converter trigger input setup time t trgs 40 ? 60 ? ns figure 27.33 note: * nmos controls p35/sck1 and p34 to output the high voltage. to output the high voltage from p35/sck1 and p34, connect an external pull-up resistor.
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 922 of 982 rej09b0054-0500 table 27.46 i 2 c bus timing conditions: v cc = 2.7 v to 3.6 v, v ss = 0 v, = 5 mhz to maximum operating frequency, t a = ?20 c to +75 c item symbol min typ max unit test conditions scl input cycle time t scl 12 t cyc ?? ns figure 27.34 scl input high pulse width t sclh 3 t cyc ?? ns scl input low pulse width t scll 5 t cyc ?? ns scl, sda input rise time t sr ?? 7.5 t cyc * ns scl, sda input fall time t sf ?? 300 ns scl, sda input spike pulse delete time t sp ?? 1 t cyc ns sda input bus free time t buf 5 t cyc ?? ns operating condition input hold time t stah 3 t cyc ?? ns retransmitting operating condition input setup time t stas 3 t cyc ?? ns stop condition input setup time t stos 3 t cyc ?? ns data input setup time t sdas 0.5 t cyc ?? ns data input hold time t sdah 0 ?? ns scl, sda capacitor load c b ?? 400 pf note: * maximum scl and sda input rise time 7.5 t cyc or 17.5 t cyc can be selected depending on the clock that is used in the i 2 c module. for detail, see section 16.6, usage notes.
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 923 of 982 rej09b0054-0500 27.5.4 a/d conversion characteristics table 27.47 lists the a/d conversion characteristics. table 27.47 a/d conversion characteristics condition a (f-ztat version and masked rom version): v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss =av ss = 0 v, = 2 to 13.5 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition b (f-ztat version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss =av ss = 0 v, = 2 to 6.25 mhz, t a = ?20 c to +75 c (regular specifications) condition c (masked rom version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss = av ss = 0 v, = 2 to 6.25 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition a conditions b, c item min typ max min typ max unit resolution 10 10 10 10 10 10 bits conversion time 9.6 ?? 20.9 ?? s analog input capacitance ?? 20 ?? 20 pf permissible signal-source impedance ?? 5 ?? 5k ? nonlinearity error ?? 6.0 ?? 6.0 lsb offset error ?? 4.0 ?? 4.0 lsb full-scale error ?? 4.0 ?? 4.0 lsb quantization error ?? 0.5 ?? 0.5 lsb absolute accuracy ?? 8.0 ?? 8.0 lsb
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 924 of 982 rej09b0054-0500 27.5.5 d/a conversion characteristics table 27.48 lists the d/a conversion characteristics. table 27.48 d/a conversion characteristics condition a (f-ztat version and masked rom version): v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss =av ss = 0 v, = 2 to 13.5 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition b (f-ztat version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss =av ss = 0 v, = 2 to 6.25 mhz, t a = ?20 c to +75 c (regular specifications) condition c (masked rom version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss = av ss = 0 v, = 2 to 6.25 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition a conditions b, c item min typ max min typ max unit test condition resolution 888888bits conversion time ?? 10 ?? 10 s load capacitance = 20 pf ? 2.0 3.0 ? 3.0 4.0 lsb load resistance = 2 m ? absolute accuracy * ?? 2.0 ?? 3.0 lsb load resistance = 4 m ? note: * does not apply in module stop mode, software standby mode, watch mode, subactive mode, or subsleep mode.
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 925 of 982 rej09b0054-0500 27.5.6 flash memory characteristics table 27.49 lists the flash memory characteristics. table 27.49 flash memory characteristics condition a: v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v,v cc = 3.0 v to 3.6 v (programming/erasing operating voltage range), t a = ?20 c to +75 c (programming/erasing operating temperature range; regular specifications), t a = ?40 c to +85 c (programming/erasing operating temperature range; wide-range specifications) condition b: v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss = av ss = 0 v, v cc = 3.0 v to 3.6 v (programming/erasing operating voltage range), t a = ?20 c to +50 c (programming/erasing operating temperature range; regular specifications) item symbol min typ max unit test conditions programming time * 1 * 2 * 4 t p ? 10 200 ms/128 bytes erase time * 1 * 3 * 5 t e ? 100 1200 ms/block reprogramming count n wec 100 * 6 10000 * 7 ? times data holding time * 8 t drp 10 ?? year programming wait time after swe1 bit setting * 1 t sswe 11 ? s wait time after psu1 bit setting * 1 t spsu 50 50 ? s t sp10 81012s t sp30 28 30 32 s 1 n 6 wait time after p1 bit setting * 1 * 4 t sp200 198 200 202 s 7 n 1000 wait time after p1 bit clear * 1 t cp 55 ? s wait time after psu1 bit clear * 1 t cpsu 55 ? s wait time after pv1 bit setting * 1 t spv 44 ? s wait time after h'ff dummy write * 1 t spvr 22 ? s wait time after pv1 bit clear * 1 t cpv 22 ? s wait time after swe1 bit clear t cswe 100 100 ? s
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 926 of 982 rej09b0054-0500 item symbol min typ max unit test conditions n1 ?? 6 * 4 times programming maximum programming count * 1 * 4 n2 ?? 994 * 4 erase wait time after swe1 bit setting * 1 t sswe 11 ? s wait time after esu1 bit setting * 1 t sesu 100 100 ? s wait time after e1 bit setting * 1 * 5 t se 10 10 100 ms wait time after e1 bit clear * 1 t ce 10 10 ? s wait time after esu1 bit clear * 1 t cesu 10 10 ? s wait time after ev1 bit setting * 1 t sev 20 20 ? s wait time after h'ff dummy write * 1 t sevr 22 ? s wait time after ev1 bit clear * 1 t cev 44 ? s wait time after swe1 bit clear t cswe 100 100 ? s maximum erase count * 1 * 5 n ?? 100 times notes: 1. make each time setting in accordance with the program/program-verify flowchart or erase/erase-verify flowchart. 2. programming time per 128 bytes (shows the total period for which the p1 bit in the flash memory control register 1 (flmcr1) is set. it does not include the program verification time.) 3. block erase time (shows the total period for which the e1 bit in flmcr1 is set. it does not include the erase verification time.) 4. maximum programming time value t p (max) = wait time after p1 bit setting (t sp ) maximum program count (n) (t sp30 + t sp10 ) 6 + (t sp200 ) 994 5. relationship among the maximum erase time (t e (max)), the wait time after e1 bit setting (t se ), and the maximum erase count (n) is shown below. t e (max) = wait time after e1 bit setting (t se ) maximum erase count (n) 6. the minimum times that all characteristics after reprogramming are guaranteed. (the range between 1 and a minimum value is guaranteed.) 7. reference value at 25 c. (normally, it is a reference that rewriting is enabled up to this value.) 8. data hold characteristics are when reprogramming is performed within the range of specifications including a minimum value.
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 927 of 982 rej09b0054-0500 27.6 electrical characteristics of h8s/2237 group and h8s/2227 group 27.6.1 absolute maximum ratings table 27.50 lists the absolute maximum ratings. table 27.50 absolute maximum ratings item symbol value unit power supply voltage v cc ?0.3 to +4.3 v program voltage * v pp ?0.3 to +13.5 v input voltage (except ports4 and 9)v in ?0.3 to v cc +0.3 v input voltage (ports 4 and 9) v in ?0.3 to av cc +0.3 v reference power supply voltage v ref ?0.3 to av cc +0.3 v analog power supply voltage av cc ?0.3 to +4.3 v analog input voltage v an ?0.3 to av cc +0.3 v operating temperature t opr regular specifications: ?20 to +75 wide-range specifications: ?40 to +85 c storage temperature t stg ?55 to +125 c caution: permanent damage to the chip may result if absolute maximum rating are exceeded. notes: the operating temperature ranges for flash memory programming/erasing are t a = ?20 c to +75 c (regular specifications) and t a = ?40 c to +85 c (wide-range specifications). * supported in the hd6472237.
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 928 of 982 rej09b0054-0500 27.6.2 dc characteristics table 27.51 lists the dc characteristics. table 27.52 lists the permissible output currents. table 27.51 dc characteristics (1) conditions (ztat version and f-ztat version): v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) * 1 conditions (masked rom version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss = av ss = 0 v, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) * 1 item symbol min typ max unit test conditions irq0 to irq7 vt ? v cc 0.2 ?? v vt + ?? v cc 0.8 v vt + ? vt ? v cc 0.07 ?? v ztat version, masked rom version schmitt trigger input voltage vt + ? vt ? v cc 0.05 ?? v f-ztat version input high voltage res , stby , nmi, md2 to md0, fwe v ih v cc 0.9 ? v cc + 0.3 v extal, ports 1, 3, 7, and a to g v cc 0.8 ? v cc + 0.3 v ports 4 and 9 v cc 0.8 ? av cc + 0.3 v input low voltage res , stby , fwe, md2 to md0 v il ?0.3 ? v cc 0.1 v nmi, extal, ports 1, 3, 4, 7, 9, and a to g ?0.3 ? v cc 0.2 v v oh v cc ? 0.5 ?? vi oh = ?200 a output high voltage all output pins v cc ? 1.0 ?? vi oh = ?1 ma * 2 all output pins v ol ?? 0.4 v i ol = 0.4 ma output low voltage ?? 0.4 v i ol = 0.8 ma * 2
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 929 of 982 rej09b0054-0500 item symbol min typ max unit test conditions res ?? 1.0 a input leakage current stby , nmi, fwe, md2 to md0 ?? 1.0 a v in = 0.5 to v cc ? 0.5 v * 3 v in = 0.2 to v cc ? 0.2 v * 4 ports 4, 9 | i in | ?? 1.0 a v in = 0.5 to av cc ? 0.5 v * 3 v in = 0.2 to av cc ? 0.2 v * 4 three states leakage current (off) ports 1, 3, 7, and a to g | i tsi | ?? 1.0 a v in = 0.5 to v cc ? 0.5 v * 3 v in = 0.2 to v cc ? 0.2 v * 4 input pull-up mos current ports a to e ?i p 10 ? 300 a v in = 0v notes: 1. if the a/d or d/a converter is not used, the av cc , v ref , and av ss pins should not be open. even if the a/d or d/a converter is not used, connect the av cc and v ref pins to v cc and supply 2.0 v to 3.6 v. in this case, v ref av cc . 2. v cc = 2.7 v to 3.6 v 3. for ztat version and masked rom version 4. for f-ztat version
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 930 of 982 rej09b0054-0500 table 27.51 dc characteristics (2) conditions (f-ztat version): v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v,v ref = 2.7 v to av cc , v ss =av ss = 0 v,t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) * 1 item symbol min typ max unit test conditions res ?? 30 pf nmi ?? 30 pf input capacitance all input pins other than above ones c in ?? 15 pf v in = 0 v f = 1 mhz t a = 25 c current consumption * 2 normal operation i cc * 4 ? 20 v cc = 3.0 v 37 v cc = 3.6 v ma f = 13.5 mhz sleep mode ? 15 v cc = 3.0 v 29 v cc = 3.6 v ma f = 13.5 mhz all modules stopped ? 15 ? ma f = 13.5 mhz, v cc = 3.0 v (reference value) medium- speed mode ( /32) ? 11 ? ma f = 13.5 mhz, v cc = 3.0 v (reference value) subactive mode ? 60 160 a v cc = 3.0 v, when 32.768 khz crystal resonator is used subsleep mode ? 35 90 a v cc = 3.0 v, when 32.768 khz crystal resonator is used watch mode ? 840av cc = 3.0 v, when 32.768 khz crystal resonator is used
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 931 of 982 rej09b0054-0500 item symbol min typ max unit test conditions current consumption * 2 ? 1.0 v cc = 3.0 v 10 v cc = 3.6 v a t a 50 c, when 32.768 khz crystal resonator is not used standby mode * 3 ?? 50 v cc = 3.6 v a 50 c < t a , when 32.768 khz crystal resonator is not used during a/d conversion al cc ? 0.8 1.5 ma av cc = 3.0 v analog power supply current idle ? 0.01 5.0 a during a/d conversion al cc ? 1.3 2.5 ma v ref = 3.0 v reference power supply current idle ? 0.01 5.0 a ram standby voltage v ram 2.0 ?? v notes: 1. if the a/d or d/a converter is not used, the av cc , v ref , and av ss pins should not be open. even if the a/d or d/a converter is not used, connect the av cc and v ref pins to v cc and supply 2.0 v to 3.6 v. in this case, v ref av cc . 2. current consumption values are for v ih min = v cc ? 0.2 v and v il max = 0.2 v, with all output pins unloaded and the on-chip mos pull-up transistors in the off state. 3. the values are for v ram v cc < 2.7 v, v ih min = v cc 0.9, and v il max = 0.3 v. 4. i cc depends on v cc and f as follows: i cc max = 1.0 (ma) + 0.74 (ma/(mhz v)) v cc f (normal operation) i cc max = 1.0 (ma) + 0.58 (ma/(mhz v)) v cc f (sleep mode)
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 932 of 982 rej09b0054-0500 table 27.51 dc characteristics (3) conditions (ztat version): v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) * 1 item symbol min typ max unit test conditions res ?? 80 pf nmi ?? 50 pf input capacitance all input pins other than above ones c in ?? 15 pf v in = 0 v f = 1 mhz t a = 25 c current consumption * 2 normal operation i cc * 4 ? 16 v cc = 3.0 v 28 v cc = 3.6 v ma f = 10 mhz sleep mode ? 12 v cc = 3.0 v 22 v cc = 3.6 v ma f = 10 mhz all modules stopped ? 12 ? ma f = 10 mhz, v cc = 3.0 v (reference value) medium- speed mode ( /32) ? 8.5 ? ma f = 10 mhz, v cc = 3.0 v (reference value) subactive mode ? 80 120 a v cc = 3.0 v, when 32.768 khz crystal resonator is used subsleep mode ? 60 90 a v cc = 3.0 v, when 32.768 khz crystal resonator is used watch mode ? 812av cc = 3.0 v, when 32.768 khz crystal resonator is used
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 933 of 982 rej09b0054-0500 item symbol min typ max unit test conditions current consumption * 2 ? 0.01 5.0 a t a 50c, when 32.768 khz crystal resonator is not used standby mode * 3 ?? 20.0 a 50c < t a , when 32.768 khz crystal resonator is not used during a/d conversion al cc ? 0.2 1.0 ma av cc = 3.0 v analog power supply current idle ? 0.01 5.0 a during a/d conversion al cc ? 1.3 2.5 ma v ref = 3.0 v reference power supply current idle ? 0.01 5.0 a ram standby voltage v ram 2.0 ?? v notes: 1. if the a/d or d/a converter is not used, the av cc , v ref , and av ss pins should not be open. even if the a/d or d/a converter is not used, connect the av cc and v ref pins to v cc and supply 2.0 v to 3.6 v. in this case, v ref av cc . 2. current consumption values are for v ih min = v cc ? 0.5 v and v il max = 0.5 v, with all output pins unloaded and the on-chip mos pull-up transistors in the off state. 3. the values are for v ram v cc < 2.7 v, v ih min = v cc 0.9, and v il max = 0.3 v. 4. i cc depends on v cc and f as follows: i cc max = 1.0 (ma) + 0.74 (ma/(mhz v)) v cc f (normal operation) i cc max = 1.0 (ma) + 0.58 (ma/(mhz v)) v cc f (sleep mode)
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 934 of 982 rej09b0054-0500 table 27.51 dc characteristics (4) conditions (masked rom version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss = av ss = 0 v, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) * 1 item symbol min typ max unit test conditions res ?? 80 pf nmi ?? 50 pf input capacitance all input pins other than above ones c in ?? 15 pf v in = 0 v, f = 1 mhz, t a = 25 c ? 20 v cc = 3.0 v 37 v cc = 3.6 v ma f = 13.5 mhz current consumption * 2 normal operation i cc * 4 ? 10 v cc = 3.0 v 18 v cc = 3.6 v ma f = 6.25 mhz ? 15 v cc = 3.0 v 29 v cc = 3.6 v ma f = 13.5 mhz sleep mode ? 7.5 v cc = 3.0 v 14 v cc = 3.6 v ma f = 6.25 mhz all modules stopped ? 15 ? ma f = 13.5 mhz, v cc = 3.0 v (reference value) medium- speed mode ( /32) ? 11 ? ma f = 13.5 mhz, v cc = 3.0 v (reference value) subactive mode ? 60 160 a v cc = 3.0 v, when 32.768 khz crystal resonator is used
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 935 of 982 rej09b0054-0500 item symbol min typ max unit test conditions current consumption * 2 subsleep mode ? 35 90 a v cc = 3.0 v, when 32.768 khz crystal resonator is used watch mode ? 840av cc = 3.0 v, when 32.768 khz crystal resonator is used ? 0.01 v cc = 3.0 v 10 v cc = 3.6 v a t a 50c, when 32.768 khz crystal resonator is not used standby mode * 3 ?? 50 v cc = 3.6 v a 50c < t a , when 32.768 khz crystal resonator is not used during a/d conversion al cc ? 0.8 1.5 ma av cc = 3.0 v analog power supply current idle ? 0.01 5.0 a during a/d conversion al cc ? 1.3 2.5 ma v ref = 3.0 v reference power supply current idle ? 0.01 5.0 a ram standby voltage v ram 2.0 ?? v notes: 1. if the a/d or d/a converter is not used, the av cc , v ref , and av ss pins should not be open. even if the a/d or d/a converter is not used, connect the av cc and v ref pins to v cc and supply 2.0 v to 3.6 v. in this case, v ref av cc . 2. current consumption values are for v ih min = v cc ? 0.5 v and v il max = 0.5 v, with all output pins unloaded and the on-chip mos pull-up transistors in the off state. 3. the values are for v ram v cc < 2.2 v, v ih min = v cc 0.9, and v il max = 0.3 v. 4. i cc depends on v cc and f as follows: i cc max = 1.0 (ma) + 0.74 (ma/(mhz v)) v cc f (normal operation) i cc max = 1.0 (ma) + 0.58 (ma/(mhz v)) v cc f (sleep mode)
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 936 of 982 rej09b0054-0500 table 27.52 permissible output currents conditions (ztat version and f-ztat version): v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) conditions (masked rom version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss = av ss = 0 v, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) item symbol min typ max unit v cc = 2.2 v to 3.6 v ?? 0.5 permissible output low current (per pin) output pins v cc = 2.7 v to 3.6 v i ol ?? 1.0 ma v cc = 2.2 v to 3.6 v ?? 30 permissible output low current (total) total of all output pins v cc = 2.7 v to 3.6 v i ol ?? 60 ma v cc = 2.2 v to 3.6 v ?? 0.5 permissible output high current (per pin) all output pins v cc = 2.7 v to 3.6 v ?i oh ?? 1.0 ma v cc = 2.2 v to 3.6 v ?? 15 permissible output high current (total) total of all output pins v cc = 2.7 v to 3.6 v ?i oh ?? 30 ma note: to protect chip reliability, do not exceed the output current values in table 27.52.
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 937 of 982 rej09b0054-0500 27.6.3 ac characteristics figure 27.9 shows the test conditions for the ac characteristics. (1) clock timing table 27.53 lists the clock timing. table 27.53 clock timing condition a (ztat version): v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 to 10 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition b (f-ztat version, masked rom version): v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 to 13.5mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition c (masked rom version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 to 6.25 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition a condition b condition c item symbol min max min max min max unit test conditions clock cycle time t cyc 100 500 74 500 160 500 ns clock high pulse width t ch 35 ? 25 ? 50 ? ns clock low pulse width t cl 35 ? 25 ? 50 ? ns clock rise time t cr ? 15 ? 10 ? 25 ns clock fall time t cf ? 15 ? 10 ? 25 ns figure 27.10 oscillation stabilization time at reset (crystal) t osc1 20 ? 20 ? 40 ? ms figure 27.11 oscillation stabilization time in software standby (crystal) t osc2 8 ? 8 ? 16 ? ms
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 938 of 982 rej09b0054-0500 condition a condition b condition c item symbol min max min max min max unit test conditions external clock output stabilization delay time t dext 500 ? 500 ? 1000 ? s figure 27.11 subclock oscillation stabilization time t osc3 ? 2 ? 2 ? 3s subclock oscillator frequency f sub 32.768 32.768 32.768 32.768 32.768 32.768 khz subclock ( sub ) cycle time t sub 30.5 30.5 30.5 30.5 30.5 30.5 s
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 939 of 982 rej09b0054-0500 (2) control signal timing table 27.54 lists the control signal timing. table 27.54 control signal timing condition a (ztat version): v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 to 10 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition b (f-ztat version, masked rom version): v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 to 13.5mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition c (masked rom version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 to 6.25 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition a condition b condition c item symbol min max min max min max unit test conditions res setup time t ress 250 ? 250 ? 350 ? ns figure 27.12 res pulse width t resw 20 ? 20 ? 20 ? t cyc mres setup time t mress 250 ? 250 ? 350 ? ns mres pulse width t mresw 20 ? 20 ? 20 ? t cyc nmi setup time t nmis 250 ? 250 ? 350 ? ns figure 27.13 nmi hold time t nmih 10 ? 10 ? 10 ? ns nmi pulse width (exiting software standby mode) t nmiw 200 ? 200 ? 300 ? ns irq setup time t irqs 250 ? 250 ? 350 ? ns irq hold time t irqh 10 ? 10 ? 10 ? ns irq pulse width (exiting software standby mode) t irqw 200 ? 200 ? 300 ? ns
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 940 of 982 rej09b0054-0500 (3) bus timing table 27.55 lists the bus timing. table 27.55 bus timing condition a (ztat version): v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 2 to 10 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition b (f-ztat version, masked rom version): v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 2 to 13.5mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition c (masked rom version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss = av ss = 0 v, = 2 to 6.25 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition a condition b condition c item symbol min max min max min max unit test conditions address delay time t ad ? 60 ? 50 ? 90 ns address setup time t as 0.5 t cyc ? 40 ? 0.5 t cyc ? 30 ? 0.5 t cyc ? 60 ? ns figures 27.14 to 27.18 address hold time t ah 0.5 t cyc ? 20 ? 0.5 t cyc ? 15 ? 0.5 t cyc ? 30 ? ns cs delay time t csd ? 60 ? 50 ? 90 ns as delay time t asd ? 60 ? 50 ? 90 ns rd delay time 1 t rsd1 ? 60 ? 50 ? 90 ns rd delay time 2 t rsd2 ? 60 ? 50 ? 90 ns read data setup time t rds 30 ? 30 ? 50 ? ns read data hold time t rdh 0 ? 0 ? 0 ? ns
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 941 of 982 rej09b0054-0500 condition a condition b condition c item symbol min max min max min max unit test conditions read data access time 1 t acc1 ? 1.0 t cyc ? 65 ? 1.0 t cyc ? 65 ? 1.0 t cyc ? 90 ns read data access time 2 t acc2 ? 1.5 t cyc ? 65 ? 1.5 t cyc ? 65 ? 1.5 t cyc ? 90 ns read data access time 3 t acc3 ? 2.0 t cyc ? 65 ? 2.0 t cyc ? 65 ? 2.0 t cyc ? 90 ns read data access time 4 t acc4 ? 2.5 t cyc ? 65 ? 2.5 t cyc ? 65 ? 2.5 t cyc ? 90 ns figures 27.14 to 27.18 read data access time 5 t acc5 ? 3.0 t cyc ? 65 ? 3.0 t cyc ? 65 ? 3.0 t cyc ? 90 ns wr delay time 1 t wrd1 ? 60 ? 50 ? 90 ns wr delay time 2 t wrd2 ? 60 ? 50 ? 90 ns wr pulse width 1 t wsw1 1.0 t cyc ? 40 ? 1.0 t cyc ? 30 ? 1.0 t cyc ? 60 ? ns wr pulse width 2 t wsw2 1.5 t cyc ? 40 ? 1.5 t cyc ? 30 ? 1.5 t cyc ? 60 ? ns write data delay time t wdd ? 80 ? 70 ? 100 ns write data setup time t wds 0.5 t cyc ? 50 ? 0.5 t cyc ? 37 ? 0.5 t cyc ? 80 ? ns write data hold time t wdh 0.5 t cyc ? 30 ? 0.5 t cyc ? 15 ? 0.5 t cyc ? 60 ? ns wait setup time t wts 60 ? 50 ? 90 ? ns figure 27.16 wait hold time t wth 10 ? 10 ? 10 ? ns breq setup time t brqs 60 ? 50 ? 90 ? ns back delay time t bacd ? 60 ? 50 ? 90 ns bus-floating time t bzd ? 100 ? 80 ? 160 ns figure 27.19
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 942 of 982 rej09b0054-0500 (4) timing of on-chip peripheral modules table 27.56 lists the timing of on-chip peripheral modules. table 27.56 timing of on-chip peripheral modules condition a (ztat version): v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 to 10 mhz,t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition b (f-ztat version, masked rom version): v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 to 13.5mhz,t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition c (masked rom version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss = av ss = 0 v, = 32.768 khz, 2 to 6.25 mhz,t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition a condition b condition c item symbol min max min max min max unit test conditions i/o port output data delay time t pwd ? 100 ? 100 ? 150 ns figure 27.24 input data setup time t prs 50 ? 50 ? 80 ? input data hold time t prh 50 ? 50 ? 80 ? tpu timer output delay time t tocd ? 100 ? 100 ? 150 ns figure 27.25 timer input setup time t tics 50 ? 40 ? 60 ? timer clock input setup time t tcks 50 ? 40 ? 60 ? ns figure 27.26 timer clock single edge t tckwh 1.5 ? 1.5 ? 1.5 ? t cyc pulse width both edges t tckwl 2.5 ? 2.5 ? 2.5 ?
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 943 of 982 rej09b0054-0500 condition a condition b condition c item symbol min max min max min max unit test conditions tmr timer output delay time t tmod ? 100 ? 100 ? 150 ns figure 27.27 timer reset input setup time t tmrs 50 ? 50 ? 80 ? ns figure 27.29 timer clock input setup time t tmcs 50 ? 50 ? 80 ? ns figure 27.28 timer clock single edge t tmcwh 1.5 ? 1.5 ? 1.5 ? t cyc pulse width both edges t tmcwl 2.5 ? 2.5 ? 2.5 ? wdt_1 buzz output delay time t buzd ? 100 ? 100 ? 150 ns figure 27.30 sci * asynchro- nous t scyc 4 ? 4 ? 4 ? t cyc figure 27.31 input clock cycle synchro- nous 6 ? 6 ? 6 ? input clock pulse width t sckw 0.4 0.6 0.4 0.6 0.4 0.6 t scyc input clock rise time t sckr ? 1.5 ? 1.5 ? 1.5 t cyc input clock fall time t sckf ? 1.5 ? 1.5 ? 1.5 transmit data delay time t txd ? 100 ? 100 ? 150 ns figure 27.32 receive data setup time (synchronous) t rxs 100 ? 75 ? 150 ? ns receive data hold time (synchronous) t rxh 100 ? 75 ? 150 ? ns a/d converter trigger input setup time t trgs 50 ? 40 ? 60 ? ns figure 27.33
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 944 of 982 rej09b0054-0500 27.6.4 a/d conversion characteristics table 27.57 lists the a/d conversion characteristics. table 27.57 a/d conversion characteristics condition a (ztat version): v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 2 to 10 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition b (f-ztat version, masked rom version): v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 2 to 13.5mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition c (masked rom version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss = av ss = 0 v, = 2 to 6.25 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition a condition b condition c item min typ max min typ max min typ max unit resolution 10 10 10 10 10 10 10 10 10 bits conversion time 13.1 ?? 9.6 ?? 20.9 ?? s analog input capacitance ?? 20 ?? 20 ?? 20 pf permissible signal-source impedance ?? 5 ?? 5 ?? 5k ? nonlinearity error ?? 6.0 ?? 6.0 ?? 6.0 lsb offset error ?? 4.0 ?? 4.0 ?? 4.0 lsb full-scale error ?? 4.0 ?? 4.0 ?? 4.0 lsb quantization error ?? 0.5 ?? 0.5 ?? 0.5 lsb absolute accuracy ?? 8.0 ?? 8.0 ?? 8.0 lsb
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 945 of 982 rej09b0054-0500 27.6.5 d/a conversion characteristics table 27.58 lists the d/a conversion characteristics. table 27.58 d/a conversion characteristics condition a (ztat version): v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 2 to 10 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition b (masked rom version): v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, = 2 to 13.5mhz, t a = ?20 c to +75 c (regular specifications) condition c (masked rom version): v cc = 2.2 v to 3.6 v, av cc = 2.2 v to 3.6 v, v ref = 2.2 v to av cc , v ss = av ss = 0 v, = 2 to 6.25 mhz, t a = ?20 c to +75 c (regular specifications), t a = ?40 c to +85 c (wide-range specifications) condition a condition b condition c item min typ max min typ max min typ max unit test condition resolution888888888bits conversion time ?? 10 ?? 10 ?? 10 s load capacitance = 20 pf ? 2.0 3.0 ? 2.0 3.0 ? 3.0 4.0 lsb load resistance = 2 m ? absolute accuracy * ?? 2.0 ?? 2.0 ?? 3.0 lsb load resistance = 4 m ? note: * does not apply in module stop mode, software standby mode, watch mode, subactive mode, or subsleep mode.
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 946 of 982 rej09b0054-0500 27.6.6 flash memory characteristics table 27.59 lists the flash memory characteristics. table 27.59 flash memory characteristics conditions: v cc = 2.7 v to 3.6 v, av cc = 2.7 v to 3.6 v, v ref = 2.7 v to av cc , v ss = av ss = 0 v, v cc = 3.0 v to 3.6 v (programming/erasing operating voltage range),t a = ?20 c to +50 c (programming/erasing operating temperature range; regular specifications) item symbol min typ max unit test conditions programming time * 1 * 2 * 4 t p ? 10 200 ms/128 bytes erase time * 1 * 3 * 5 t e ? 100 1200 ms/block reprogramming count n wec 100 * 6 10000 * 7 ? times data holding time * 8 t drp 10 ?? year programming wait time after swe1 bit setting * 1 t sswe 11 ? s wait time after psu1 bit setting * 1 t spsu 50 50 ? s wait time after p1 bit setting * 1 * 4 t sp10 8 1012s t sp30 28 30 32 s 1 n 6 t sp200 198 200 202 s 7 n 1000 wait time after p1 bit clear * 1 t cp 55 ? s wait time after psu1 bit clear * 1 t cpsu 55 ? s wait time after pv1 bit setting * 1 t spv 44 ? s wait time after h'ff dummy write * 1 t spvr 22 ? s wait time after pv1 bit clear * 1 t cpv 22 ? s wait time after swe1 bit clear t cswe 100 100 ? s maximum programming count * 1 * 4 n1 ?? 6 * 4 times n2 ?? 994 * 4
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 947 of 982 rej09b0054-0500 item symbol min typ max unit test conditions erase wait time after swe1 bit setting * 1 t sswe 11 ? s wait time after esu1 bit setting * 1 t sesu 100 100 ? s wait time after e1 bit setting * 1 * 5 t se 10 10 100 ms wait time after e1 bit clear * 1 t ce 10 10 ? s wait time after esu1 bit clear * 1 t cesu 10 10 ? s wait time after ev1 bit setting * 1 t sev 20 20 ? s wait time after h'ff dummy write * 1 t sevr 22 ? s wait time after ev1 bit clear * 1 t cev 44 ? s wait time after swe1 bit clear t cswe 100 100 ? s maximum erase count * 1 * 5 n ?? 100 times notes: 1. make each time setting in accordance with the program/program-verify flowchart or erase/erase-verify flowchart. 2. programming time per 128 bytes (shows the total period for which the p1 bit in the flash memory control register 1 (flmcr1) is set. it does not include the program verification time.) 3. block erase time (shows the total period for which the e1 bit in flmcr1 is set. it does not include the erase verification time.) 4. maximum programming time value t p (max) = wait time after p1 bit setting (t sp ) maximum program count (n) (t sp30 + t sp10 ) 6 + (t sp200 ) 994 5. relationship among the maximum erase time (t e (max)), the wait time after e1 bit setting (t se ), and the maximum erase count (n) is shown below. t e (max) = wait time after e1 bit setting (t se ) maximum erase count (n) 6. the minimum times that all characteristics after reprogramming are guaranteed. (the range between 1 and a minimum value is guaranteed.) 7. reference value at 25 c. (normally, it is a reference that rewriting is enabled up to this value.) 8. data hold characteristics are when reprogramming is performed within the range of specifications including a minimum value.
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 948 of 982 rej09b0054-0500 27.7 operating timing 27.7.1 clock timing the clock timing is shown below. t cr t cl t cf t ch t cyc figure 27.10 system clock timing t osc1 t osc1 extal v cc stby res t dext t dext figure 27.11 oscillation stabilization timing
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 949 of 982 rej09b0054-0500 27.7.2 control signal timing the control signal timing is shown below. t resw t ress t mress t mress t mresw t ress res mres figure 27.12 reset input timing t irqs irq edge input t irqh t nmis t nmih t irqs irq level input nmi irq t nmiw t irqw figure 27.13 interrupt input timing
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 950 of 982 rej09b0054-0500 27.7.3 bus timing figures 27.14 to 27.19 show the bus timing. t rsd2 t as t ah t csd t acc2 t rsd1 t asd t asd t ad t acc3 t wrd2 t wrd2 t wsw1 t wdd t wdh t 1 t 2 t rds t ah t as t as t rdh as a23 to a0 rd (read) cs7 to cs0 d15 to d0 (read) hwr , lwr (write) d15 to d0 (write) figure 27.14 basic bus timing (two-state access)
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 951 of 982 rej09b0054-0500 t rsd2 t as t ah t csd t acc4 t rsd1 t asd t asd t ad t acc5 t wrd2 t wrd1 t wsw2 t wdd t wdh t 1 t 3 t wds t 2 t rds t as t ah t rdh as a23 to a0 rd (read) cs7 to cs0 d15 to d0 (read) hwr , lwr (write) d15 to d0 (write) figure 27.15 basic bus timing (three-state access)
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 952 of 982 rej09b0054-0500 t wth t 1 t 2 wait t w t 3 t wts t wth t wts as a23 to a0 rd (read) cs7 to cs0 d15 to d0 (read) hwr , lwr (write) d15 to d0 (write) figure 27.16 basic bus timing (three-state access with one wait state)
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 953 of 982 rej09b0054-0500 t rsd2 t as t ah t asd t asd t ad t acc3 t rds t rdh t 1 t 2 t 2 or t 3 t 1 cs0 as a23 to a0 rd (read) d15 to d0 (read) figure 27.17 burst rom access timing (two-state access)
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 954 of 982 rej09b0054-0500 t ad t acc1 t rds t rdh t 1 t 2 or t 3 t 1 t rsd2 cs0 as a23 to a0 rd (read) d15 to d0 (read) figure 27.18 burst rom access timing (one-state access) breq back t bacd t bzd a23 to a0, cs7 to cs0 , as , rd , hwr , lwr t bacd t bzd t brqs t brqs figure 27.19 external bus release timing
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 955 of 982 rej09b0054-0500 t dacd1 t 1 t 2 dack1 , dack0 t dacd2 as a23 to a0 rd (read) cs7 to cs0 d15 to d0 (read) hwr , lwr (write) d15 to d0 (write) figure 27.20 dmac single address transfer timing (two-state access)
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 956 of 982 rej09b0054-0500 t dacd1 t 1 t 2 t dacd2 t 3 dack1 , dack0 as a23 to a0 rd (read) cs7 to cs0 d15 to d0 (read) hwr , lwr (write) d15 to d0 (write) figure 27.21 dmac single address transfer timing (three-state access)
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 957 of 982 rej09b0054-0500 t ted t 2 or t 3 t 1 tend1 , tend0 t ted figure 27.22 dmac tend output timing t drqh t drqs dreq1 , dreq0 figure 27.23 dmac dreq input timing 27.7.4 timing of on-chip peripheral modules figures 27.24 to 27.34 show the timing of on-chip peripheral modules. t prs t 1 t 2 t pwd t prh ports 1, 3, 4, 7, 9, a to g (read) ports 1, 3, 7, a to g (write) figure 27.24 i/o port input/output timing
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 958 of 982 rej09b0054-0500 t tics t tocd output compare output * input capture input * note: * tioca5 to tioca0, tiocb5 to tiocb0, tiocc3, tiocc0, tiocd3, tiocd0 tioca5 to tioca3, tiocb5 to tiocb3, tiocc3 and tiocd3 are not available in the h8s/2227 group. figure 27.25 tpu input/output timing t tcks t tcks tclka to tclkd t tckwh t tckwl figure 27.26 tpu clock input timing t tmod tmo3 to tmo0 * note: * tmo0 and tmo1 for the h8s/2237 group and h8s/2227 group. figure 27.27 8-bit timer output timing
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 959 of 982 rej09b0054-0500 t tmcs t tmcs tmci23 * , tmci01 t tmcwh t tmcwl note: * not available in the h8s/2237 group and h8s/2227 group. figure 27.28 8-bit timer clock input timing t tmrs tmci23 * , tmci01 note: * not available in the h8s/2237 group and h8s/2227 group figure 27.29 8-bit timer reset input timing t buzd buzz t buzd figure 27.30 wdt_1 output timing t scyc t sckr t sckw sck3 to sck0 * t sckf note: * sck2 is not aveilable in the h8s/2227 group. figure 27.31 sck clock input timing
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 960 of 982 rej09b0054-0500 sck3 to sck0 * txd3 to txd0 * (transmit data) rxd3 to rxd0 * (receive data) t txd t rxh t rxs note: * sck2, txd2, and rxd2 are not available in the h8s/2227 group. figure 27.32 sci input/output timing (clocked synchronous mode) t trgs adtrg figure 27.33 a/d converter external trigger input timing t buf t stah t stas t sp t stos t sclh t scll t sf t sr t scl t sdah t sdas p * s * s r * v ih v il sda1 to sda0 scl1 to scl0 note: * s, p, and sr indicate the following conditions. s: start condition p: stop condition sr: retransmission start condition figure 27.34 i 2 c bus interface input/output timing (optional)
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 961 of 982 rej09b0054-0500 27.8 usage note though the f-ztat version and the masked rom version satisfy electrical characteristics described in this manual, the actual value of electrical characteristics, operating margin, and noise margin may differ due to the differences of production process, on-chip rom, and layout patterning. when the system has been evaluated with the f-ztat version, the equivalent evaluation should be implemented to the masked rom version when shifted to the masked rom version.
section 27 electrical characteristics rev. 5.00 aug 08, 2006 page 962 of 982 rej09b0054-0500
appendix a i/o port states in each pin state rev. 5.00 aug 08, 2006 page 963 of 982 rej09b0054-0500 appendix a i/o port states in each pin state a.1 i/o port state in each pin state port name pin name mcu operating mode power-on reset manual reset hardware standby mode software standby mode, watch mode bus mastership release state program execution state, sleep mode, subsleep mode p17 to p14 4 to 7 t keep t keep keep i/o port p13/tiocd0/ tclkb/a23 p12/tiocc0/ tclka/a22 p11/tiocb0/ a21 7 t keep t keep keep i/o port when the address output is selected by the aen bit 4 to 6 t keep t [ope = 0] t [ope = 1] keep t address output when a port is selected 4 to 6 t keep t keep keep i/o port p10/tioca0/ dack0 * 3 /a20 7 t keep t keep keep i/o port 4, 5 l when the address output is selected by the aen bit 6t keep t [ope = 0] t [ope = 1] keep t address output when a port is selected 4 to 6 t * 1 keep t keep keep i/o port
appendix a i/o port states in each pin state rev. 5.00 aug 08, 2006 page 964 of 982 rej09b0054-0500 port name pin name mcu operating mode power-on reset manual reset hardware standby mode software standby mode, watch mode bus mastership release state program execution state, sleep mode, subsleep mode port 3 4 to 7 t keep t keep keep i/o port port 4 4 to 7 t t t t t input port p77 to p74 4 to 7 t keep t keep keep i/o port 7 t keep t keep keep i/o port p73/tmo1/ tend1 * 3 / cs7 p72/tmo0/ tend0 * 3 / cs6 p71/tmri23 * 2 / tmci23 * 2 / dreq1 * 3 / cs5 p70/tmri01/ tmci01/ dreq0 * 3 / cs4 4 to 6 t keep t [ddr ? ope = 0] t [ddr ? ope = 1] h t [ddr = 0] input port [ddr = 1] cs7 to cs4 p97/da1 * 4 p96/da0 * 4 4 to 7 t t t [daoen = 1] keep [daoen = 0] t keep input port 7 t keep t keep keep i/o port 4, 5 l when the address output is selected by the aen bit 6t keep t [ope = 0] t [ope = 1] keep t address output port a when a port is selected 4 to 6 t * 1 keep t keep keep i/o port
appendix a i/o port states in each pin state rev. 5.00 aug 08, 2006 page 965 of 982 rej09b0054-0500 port name pin name mcu operating mode power-on reset manual reset hardware standby mode software standby mode, watch mode bus mastership release state program execution state, sleep mode, subsleep mode 7 t keep t keep keep i/o port 4, 5 l when the address output is selected by the aen bit 6t keep t [ope = 0] t [ope = 1] keep t address output port b when a port is selected 4 to 6 t * 1 keep t keep keep i/o port 4, 5 l keep t [ope = 0] t [ope = 1] keep t address output 6 t keep t [ddr ? ope = 0] t [ddr ? ope = 1] keep t [ddr = 0] input port [ddr = 1] address output port c 7 t keep t keep keep i/o port 4 to 6 t t t t t data bus port d 7 t keep t keep keep i/o port 8-bit bus 4 to 6 t keep t keep keep i/o port 4 to 6 t t t t t data bus port e 16-bit bus 7 t keep t keep keep i/o port
appendix a i/o port states in each pin state rev. 5.00 aug 08, 2006 page 966 of 982 rej09b0054-0500 port name pin name mcu operating mode power-on reset manual reset hardware standby mode software standby mode, watch mode bus mastership release state program execution state, sleep mode, subsleep mode 4 to 6 clock output [ddr = 0] input port [ddr = 1] clock output t [ddr = 0] input port [ddr = 1] h [ddr = 0] input port [ddr = 1] clock output [ddr = 0] input port [ddr = 1] clock output pf7/ 7 t keep t [ddr = 0] input port [ddr = 1] h [ddr = 0] input port [ddr = 1] clock output [ddr = 0] input port [ddr = 1] clock output 4 to 6 h h t [ope= 0] t [ope= 1] h t as , rd , hwr pf6/ as pf5/ rd pf4/ hwr 7 t keep t keep keep i/o port pf3/ lwr / adtrg / irq3 7 t keep t keep keep i/o port 8-bit bus 4 to 6 keep t keep keep i/o port 16-bit bus 4 to 6 (mode 4) h (mode 5, 6) t ht [ope = 0] t [ope = 1] h t lwr 4 to 6 t keep t [waite = 0] keep [waite = 1] t [waite = 0] keep [waite = 1] t [waite = 0] i/o port [waite = 1] wait pf2/ wait 7 t keep t keep keep i/o port 4 to 6 t keep t [brle = 0] keep [brle = 1] h l[brle = 0] i/o port [brle = 1] back pf1/ back / buzz 7 t keep t keep keep i/o port
appendix a i/o port states in each pin state rev. 5.00 aug 08, 2006 page 967 of 982 rej09b0054-0500 port name pin name mcu operating mode power-on reset manual reset hardware standby mode software standby mode, watch mode bus mastership release state program execution state, sleep mode, subsleep mode 4 to 6 t keep t [brle = 0] keep [brle = 1] t t[brle = 0] i/o port [brle = 1] breq pf0/ breq / irq2 7 t keep t keep keep i/o port 4, 5 h 6t keep t [ddr ? ope = 0] t [ddr ? ope = 1] h t [ddr = 0] i/o port [ddr = 1] cs0 (h in sleep mode and subsleep mode.) pg4/ cs0 7 t keep t keep keep i/o port 4 to 6 t keep t [ddr ? ope = 0] t [ddr ? ope = 1] h t [ddr = 0] input port [ddr = 1] cs1 to cs3 pg3/ cs1 pg2/ cs2 pg1/ cs3 / irq7 7 t keep t keep keep i/o port pg0/ irq6 4 to 7 t keep t keep keep i/o port legend: h: high level l: low level t: high-impedance keep: the input port becomes high-impedance, and the output port retains its state ddr: data direction register ope: output port enable waite: wait input enable brle: bus release enable notes: 1. the port state is l (address input) in modes 4 and 5. 2. not available in the h8s/2237 group and h8s/2227 group. 3. supported only by the h8s/2239 group. 4. not available in the h8s/2227 group.
appendix b product codes rev. 5.00 aug 08, 2006 page 968 of 982 rej09b0054-0500 appendix b product codes table b.1 product codes of h8s/2258 group product type product code mark code package (package code) h8s/2258 hd64f2258 hd64f2258te13 100-pin tqfp (tfp-100b) standard product hd64f2258f13 100-pin qfp (fp-100a) flash memory version hd64f2258fa13 100-pin qfp (fp-100b) hd6432258 hd6432258( *** )te 100-pin tqfp (tfp-100b) standard product hd6432258( *** )f 100-pin qfp (fp-100a) masked rom version hd6432258( *** )fa 100-pin qfp (fp-100b) HD6432256 HD6432256( *** )te 100-pin tqfp (tfp-100b) HD6432256( *** )f 100-pin qfp (fp-100a) HD6432256( *** )fa 100-pin qfp (fp-100b) hd6432258w hd6432258w( *** )te 100-pin tqfp (tfp-100b) hd6432258w( *** )f 100-pin qfp (fp-100a) on-chip i 2 c bus interface product hd6432258w( *** )fa 100-pin qfp (fp-100b) HD6432256w HD6432256w( *** )te 100-pin tqfp (tfp-100b) HD6432256w( *** )f 100-pin qfp (fp-100a) HD6432256w( *** )fa 100-pin qfp (fp-100b) legend: ( *** ): rom code note: a standard product of f-ztat version includes an i 2 c bus interface. please contact renesas technology agency to confirm the current status of each product.
appendix b product codes rev. 5.00 aug 08, 2006 page 969 of 982 rej09b0054-0500 table b.2 product codes of h8s/2239 group product type product code mark code package (package code) h8s/2239 hd64f2239 hd64f2239te20 100-pin tqfp (tfp-100b) standard product hd64f2239tf20 100-pin tqfp (tfp-100g) flash memory version hd64f2239fa20 100-pin qfp (fp-100b) hd64f2239bq20 112-pin tfbga (tbp-112a) hd64f2239te16 100-pin tqfp (tfp-100b) hd64f2239tf16 100-pin tqfp (tfp-100g) hd64f2239fa16 100-pin qfp (fp-100b) hd64f2239bq16 112-pin tfbga (tbp-112a) hd6432239 hd6432239( *** )te 100-pin tqfp (tfp-100b) standard product hd6432239( *** )tf 100-pin tqfp (tfp-100g) masked rom version hd6432239( *** )fa 100-pin qfp (fp-100b) hd6432239w hd6432239w( *** )te 100-pin tqfp (tfp-100b) hd6432239w( *** )tf 100-pin tqfp (tfp-100g) on-chip i 2 c bus interface product hd6432239w( *** )fa 100-pin qfp (fp-100b) legend: ( *** ): rom code note: a standard product of f-ztat version includes an i 2 c bus interface. please contact renesas technology agency to confirm the current status of each product.
appendix b product codes rev. 5.00 aug 08, 2006 page 970 of 982 rej09b0054-0500 table b.3 product codes of h8s/2238 group product type product code mark code package (package code) h8s/2238b 5-v version hd64f2238b hd64f2238bte13 100-pin tqfp (tfp-100b) hd64f2238btf13 100-pin tqfp (tfp-100g) flash memory version hd64f2238bf13 100-pin qfp (fp-100a) hd64f2238bfa13 100-pin qfp (fp-100b) 5-v version hd6432238b hd64f2238b( *** )te 100-pin tqfp (tfp-100b) hd64f2238b( *** )tf 100-pin tqfp (tfp-100g) masked rom version hd64f2238b( *** )f 100-pin qfp (fp-100a) hd64f2238b( *** )fa 100-pin qfp (fp-100b) hd6432238bw hd64f2238bw( *** )te 100-pin tqfp (tfp-100b) hd64f2238bw( *** )tf 100-pin tqfp (tfp-100g) on-chip i 2 c bus interface product (5-v version) hd64f2238bw( *** )f 100-pin qfp (fp-100a) hd64f2238bw( *** )fa 100-pin qfp (fp-100b) h8s/2238r 3-v version hd64f2238r hd64f2238rte13 100-pin tqfp (tfp-100b) hd64f2238rtf13 100-pin tqfp (tfp-100g) flash memory version hd64f2238rfa13 100-pin qfp (fp-100b) hd64f2238rbq13 112-pin tfbga (tbp-112a) hd64f2238rbr13 112-pin lfbga (bp-112) hd64f2238r hd64f2238rte6 100-pin tqfp (tfp-100b) 2.2-v version hd64f2238rtf6 100-pin tqfp (tfp-100g) hd64f2238rfa6 100-pin qfp (fp-100b) hd64f2238rbq6 112-pin tfbga (tbp-112a) hd64f2238rbr6 112-pin lfbga (bp-112) hd6432238r hd64f2238r( *** )te 100-pin tqfp (tfp-100b) 3-v version, 2.2-v version hd64f2238r( *** )tf 100-pin tqfp (tfp-100g) masked rom version hd64f2238r( *** )fa 100-pin qfp (fp-100b) hd6432238rw hd64f2238rw( *** )te 100-pin tqfp (tfp-100b) hd64f2238rw( *** )tf 100-pin tqfp (tfp-100g) on-chip i 2 c bus interface product (3-v version) hd64f2238rw( *** )fa 100-pin qfp (fp-100b)
appendix b product codes rev. 5.00 aug 08, 2006 page 971 of 982 rej09b0054-0500 product type product code mark code package (package code) h8s/2236b hd6432236b hd64f2236b( *** )te 100-pin tqfp (tfp-100b) 5-v version hd64f2236b( *** )tf 100-pin tqfp (tfp-100g) hd64f2236b( *** )f 100-pin qfp (fp-100a) masked rom version hd64f2236b( *** )fa 100-pin qfp (fp-100b) hd6432236bw hd64f2236bw( *** )te 100-pin tqfp (tfp-100b) hd64f2236bw( *** )tf 100-pin tqfp (tfp-100g) hd64f2236bw( *** )f 100-pin qfp (fp-100a) on-chip i 2 c bus interface product (5-v version) hd64f2236bw( *** )fa 100-pin qfp (fp-100b) h8s/2236r hd6432236r hd64f2236r( *** )te 100-pin tqfp (tfp-100b) 3-v version, 2.2-v version hd64f2236r( *** )tf 100-pin tqfp (tfp-100g) masked rom version hd64f2236r( *** )fa 100-pin qfp (fp-100b) hd6432236rw hd64f2236rw( *** )te 100-pin tqfp (tfp-100b) hd64f2236rw( *** )tf 100-pin tqfp (tfp-100g) on-chip i 2 c bus interface product (3-v version) hd64f2236rw( *** )fa 100-pin qfp (fp-100b) legend: ( *** ): rom code note: please contact renesas technology agency to confirm the current status of each product.
appendix b product codes rev. 5.00 aug 08, 2006 page 972 of 982 rej09b0054-0500 table b.4 product codes of h8s/2237 group and h8s/2227 group product type product code mark code package (package code) h8s/2237 flash memory version hd6472237 hd6472237te10 100-pin tqfp (tfp-100b) hd6472237tf10 100-pin tqfp (tfp-100g) hd6472237f10 100-pin qfp (fp-100a) hd6472237fa10 100-pin qfp (fp-100b) masked rom version hd6432237 hd6432237( *** )te 100-pin tqfp (tfp-100b) hd6432237( *** )tf 100-pin tqfp (tfp-100g) hd6432237( *** )f 100-pin qfp (fp-100a) hd6432237( *** )fa 100-pin qfp (fp-100b) h8s/2235 masked rom version hd6432235 hd6432235( *** )te 100-pin tqfp (tfp-100b) hd6432235( *** )tf 100-pin tqfp (tfp-100g) hd6432235( *** )f 100-pin qfp (fp-100a) hd6432235( *** )fa 100-pin qfp (fp-100b) h8s/2233 masked rom version hd6432233 hd6432233( *** )te 100-pin tqfp (tfp-100b) hd6432233( *** )tf 100-pin tqfp (tfp-100g) hd6432233( *** )f 100-pin qfp (fp-100a) hd6432233( *** )fa 100-pin qfp (fp-100b) h8s/2227 flash memory version hd64f2227 hd64f2227te13 100-pin tqfp (tfp-100b) hd64f2227tf13 100-pin tqfp (tfp-100g) masked rom version hd6432227 hd6432227( *** )te 100-pin tqfp (tfp-100b) hd6432227( *** )tf 100-pin tqfp (tfp-100g) hd6432227( *** )f 100-pin qfp (fp-100a) hd6432227( *** )fa 100-pin qfp (fp-100b) h8s/2225 * masked rom version hd6432225 hd6432225( *** )te 100-pin tqfp (tfp-100b) hd6432225( *** )tf 100-pin tqfp (tfp-100g) hd6432225( *** )fa 100-pin qfp (fp-100b) h8s/2224 * masked rom version hd6432224 hd6432224( *** )te 100-pin tqfp (tfp-100b) hd6432224( *** )tf 100-pin tqfp (tfp-100g) hd6432224( *** )fa 100-pin qfp (fp-100b) h8s/2223 * masked rom version hd6432223 hd6432223( *** )te 100-pin tqfp (tfp-100b) hd6432223( *** )tf 100-pin tqfp (tfp-100g) hd6432223( *** )fa 100-pin qfp (fp-100b) legend: ( *** ): rom code note: * the 100-pin qfp (fp-100a) is not available for the hd6432225, hd6432224, and hd6432223. when the 100-pin qfp (fp-100a) is necessary, choose hd6432235( *** )f, hd6432233( *** )f, or hd6432227( *** )f.
appendix c package dimensions rev. 5.00 aug 08, 2006 page 973 of 982 rej09b0054-0500 appendix c package dimensions note) 1. dimensions" * 1"and" * 2" do not include mold flash 2. dimension" * 3"does not include trim offset. ptqp0100ka-a p-tqfp100-14x14-0.50 1.00 1.00 0.08 0.10 0.5 8 0 15.8 16.0 16.2 0.15 0.20 1.20 0.20 0.10 0.00 0.27 0.22 0.17 0.22 0.17 0.12 1 e d 1 1 p 1 e d 2 l z z y x c b b a h a e d a c e e l h mass[typ.] 0.5g tfp-100b/tfp-100bv renesas code jeita package code previous code 0.6 0.5 0.4 max nom min dimension in millimeters symbol reference 14 1.00 16.2 16.0 15.8 1.0 14 index mark * 1 * 2 * 3 p e d e d 100 1 f xm y 26 25 76 75 50 51 z z h e h d b 2 1 1 detail f c l a a a l terminal cross section p 1 1 b c b c figure c.1 tfp-100b package dimensions
appendix c package dimensions rev. 5.00 aug 08, 2006 page 974 of 982 rej09b0054-0500 note) 1. dimensions" * 1"and" * 2" do not include mold flash 2. dimension" * 3"does not include trim offset. index mark * 1 * 2 * 3 p e d e d yx f 100 125 26 76 75 50 51 e h d h b z z 2 1 1 detail f c a a l a l terminal cross section 1 1 p b c c b ptqp0100lc-a p-tqfp100-12x12-0.40 h l e e c a d e a h a b b c x y z z l 2 d e 1 p 1 1 d e 1 mass[typ.] 0.4g reference symbol dimension in millimeters min nom max previous code jeita package code renesas code tfp-100g/tfp-100gv 1.0 0.10 0 ? 8 ? 0.4 0.12 0.17 0.22 0.13 0.18 0.23 0.00 0.10 0.20 1.20 13.8 14.0 14.2 1.00 12 0.16 0.15 0.4 0.5 0.6 0.07 14.2 14.0 13.8 1.2 12 1.2 m figure c.2 tfp-100g package dimensions
appendix c package dimensions rev. 5.00 aug 08, 2006 page 975 of 982 rej09b0054-0500 note) 1. dimensions" * 1"and" * 2" do not include mold flash 2. dimension" * 3"does not include trim offset. prqp0100je-b p-qfp100-14x20-0.65 0.83 0.58 0.15 0.13 0.65 10 0 19.2 18.8 18.4 3.10 0.12 0.17 0.22 0.24 0.32 0.40 0.00 0.30 0.15 0.20 0.30 20 14 l d 1 e d 1 1 p 1 e d 2 z z y x c b b a h a e a c e e l h 1.7g mass[typ.] 2.4 24.4 24.8 25.2 2.70 reference symbol dimension in millimeters min nom max 1.0 1.2 1.4 previous code jeita package code renesas code fp-100a/fp-100av * 1 * 2 * 3 p e d e d 51 50 80 81 30 31 1 100 f ymx z z b h e h d 2 1 1 detail f c l aa a l terminal cross section p 1 1 b c b c figure c.3 fp-100a package dimensions
appendix c package dimensions rev. 5.00 aug 08, 2006 page 976 of 982 rej09b0054-0500 note) 1. dimensions" * 1"and" * 2" do not include mold flash 2. dimension" * 3"does not include trim offset. * 1 * 2 * 3 p e d e d f 100 12 5 26 76 75 51 50 xm y z z d h e h b terminal cross section p 1 1 c b c b 2 1 1 detail f c a a l l a prqp0100ka-a p-qfp100-14x14-0.50 1.0 1.0 0.08 0.10 0.5 8 0 0.25 0.12 0.15 0.20 0.00 0.27 0.22 0.17 0.22 0.17 0.12 3.05 16.3 16.0 15.7 1 e d 1 1 p 1 e d 2 l z z y x c b b a h a e d a c e e l h mass[typ.] 1.2g fp-100b/fp-100bv renesas code jeita package code previous code 0.7 0.5 0.3 max nom min dimension in millimeters symbol reference 14 2.70 16.3 16.0 15.7 1.0 14 figure c.4 fp-100b package dimensions
appendix c package dimensions rev. 5.00 aug 08, 2006 page 977 of 982 rej09b0054-0500 l k j h g f e d c b 11 10 9 8 7 6 5 4 3 2 1 ys v b ws a ws ys s b a a 1 1 a a plbg0112ga-a p-lfbga112-10x10-0.80 d e s s d e z z d z d e z e mass[typ.] 0.3g bp-112/bp-112v renesas code jeita package code previous code 0.15 0.20 1 0.2 y 1.00 1.00 w v 0.08 10.00 1.40 0.45 0.40 0.35 0.55 0.50 0.45 0.80 0.10 10.00 1 y x b a reference symbol dimension in millimeters min nom max a e e e b a s figure c.5 bp-112 package dimensions
appendix c package dimensions rev. 5.00 aug 08, 2006 page 978 of 982 rej09b0054-0500 d e e a max nom min dimension in millimeters symbol reference a b x y 1 10.00 0.10 0.80 0.45 0.50 0.55 0.35 0.40 0.45 1.20 10.00 0.08 v w 1.00 1.00 y 0.2 1 0.30 0.20 previous code jeita package code renesas code tbp-112a/tbp-112av 0.2g mass[typ.] e d z z e d z z e d s s e d t-tfbga112-10x10-0.80 ttbg0112ga-a 1 1 a a b s s y s wa s wb v s y 1 234567891011 b c d e f g h j k l a a e e b a s figure c.6 tbp-112a, tbp-112av package dimensions
index rev. 5.00 aug 08, 2006 page 979 of 982 rej09b0054-0500 index 16-bit timer pulse unit.......................... 359 a/d conversion time............................. 699 a/d converter ........................................ 689 a/d converter activation....................... 426 absolute address...................................... 91 abwcr...................................812, 823, 834 activation by software ........................... 302 adcr ..............................695, 816, 828, 838 adcsr............................693, 816, 828, 838 addr..............................692, 816, 828, 838 address space........................................... 70 addressing modes .................................... 90 adi ......................................................... 701 advanced mode........................................ 67 analog input channel............................. 692 arithmetic operations instructions........... 82 astcr ....................................812, 823, 834 asynchronous mode ............................... 585 bara ..............................158, 810, 820, 832 barb ..............................159, 810, 820, 832 bcc............................................................ 87 bcra ..............................159, 810, 820, 832 bcrb...............................160, 810, 820, 832 bcrh ......................................812, 823, 834 bcrl.......................................812, 823, 834 bit manipulation instructions ................... 85 bit rate ..................................................... 571 bit rate ................................................... 571 block data transfer instructions .............. 89 block transfer mode ................................ 296 branch instructions ................................... 87 break....................................................... 625 break address .................................. 157, 160 break conditions...................................... 160 brr .................................571, 815, 827, 837 buffer operation..................................... 405 cascaded operation ................................ 409 chain transfer ........................................ 298 cmia...................................................... 458 cmib ...................................................... 458 condition field ......................................... 89 condition-code register .......................... 74 cpu........................................................... 63 cra ................................ 286, 808, 818, 830 crb ................................ 286, 808, 818, 830 d/a converter......................................... 707 dacr ............................. 709, 809, 819, 831 dadr ............................. 708, 809, 819, 831 dar................................ 285, 808, 818, 830 data transfer controller ......................... 281 data transfer instructions......................... 81 ddcswr ....................... 653, 809, 819, 831 dend0a ................................................ 275 dend0b................................................. 275 dend1a ................................................ 275 dend1b................................................. 275 dmabcr ............................... 814, 826, 836 dmacr.................................. 814, 826, 836 dmatcr ............................... 814, 826, 836 dmawer .............................. 814, 826, 836 dtc vector table .................................. 290 dtcer ........................... 286, 810, 820, 832 dtvecr ........................ 288, 810, 820, 832 ebr1....................................... 817, 828, 838 ebr2....................................... 817, 828, 838 effective address...................................... 94 effective address extension..................... 89 eri.......................................................... 623 etcr ...................................... 813, 823, 834 exception handling ................................ 119 exception handling vector table........... 120 extended control register ........................ 73 external trigger input timing................ 701 flmcr1................................. 816, 828, 838 flmcr2................................. 817, 828, 838 flpwcr ................................ 817, 828, 838
index rev. 5.00 aug 08, 2006 page 980 of 982 rej09b0054-0500 framing error ........................................... 592 free-running count operation.................. 399 general registers ...................................... 72 i 2 c bus format ......................................... 653 i 2 c bus interface..................................... 633 iccr ............................... 644, 815, 827, 836 icdr ............................... 637, 815, 827, 837 icmr ...................................... 640, 827, 837 icmr/sar ............................................. 815 icsr................................ 649, 815, 827, 837 ier .......................................... 810, 820, 832 immediate ................................................. 92 input capture function ........................... 402 instruction set ........................................... 79 internal block diagram............................... 4 interrupt mask bit..................................... 74 interrupts ................................................. 124 interval timer mode ............................... 474 ioar....................................... 813, 823, 834 ipr .......................................... 812, 822, 834 iscr........................................ 810, 820, 832 isr .......................................... 810, 820, 832 list of registers ...................................... 807 logic operations instructions ................... 84 lpwrcr ................................ 810, 820, 831 mar ....................................... 812, 823, 834 mark state............................................... 625 mask rom.............................................. 753 mdcr............................. 104, 810, 820, 831 memory indirect ....................................... 93 memory map .......................................... 109 mra ............................... 283, 808, 818, 830 mrb................................ 285, 808, 818, 830 mstpcr................................. 810, 820, 831 multiprocessor communication function ................................................................ 596 nmi interrupt request.............................. 476 normal mode ............................ 66, 295, 303 operating mode selection....................... 103 operation field ......................................... 89 overflow .................................................. 474 overrun error ........................................... 592 ovi ......................................................... 458 p1ddr .................................... 810, 821, 832 p1dr....................................... 813, 824, 835 p3ddr .................................... 810, 821, 832 p3dr....................................... 813, 824, 835 p3odr .................................... 811, 821, 832 p7ddr .................................... 810, 821, 832 p7dr....................................... 813, 824, 835 paddr ................................... 810, 821, 832 padr ...................................... 813, 824, 835 paodr ................................... 811, 821, 833 papcr .................................... 811, 821, 832 parity error............................................... 592 pbddr ................................... 810, 821, 832 pbdr ...................................... 813, 824, 835 pbpcr .................................... 811, 821, 832 pc break controller................................ 157 pcddr ................................... 810, 821, 832 pcdr ...................................... 813, 824, 835 pcpcr .................................... 811, 821, 832 pdddr ................................... 810, 821, 832 pddr ...................................... 813, 824, 835 pdpcr .................................... 811, 821, 832 peddr.................................... 810, 821, 832 pedr ...................................... 813, 824, 835 pepcr .................................... 811, 821, 832 periodic count operation.......................... 399 pfcr....................................... 810, 820, 831 pfddr.................................... 811, 821, 832 pfdr....................................... 813, 824, 835 pgddr ................................... 811, 821, 832 pgdr ...................................... 813, 824, 835 phase counting mode ............................. 416 pin arrangements in each mode............... 20 pin functions............................................. 44 pointer (sp) ............................................... 72 port1 .................................... 817, 828, 838 port3 .................................... 817, 828, 838 port4 .................................... 817, 828, 838 port7 .................................... 817, 828, 838
index rev. 5.00 aug 08, 2006 page 981 of 982 rej09b0054-0500 port9.....................................817, 828, 838 porta ....................................817, 828, 838 portb ....................................817, 828, 838 portc ....................................817, 828, 838 portd ....................................817, 828, 838 porte ....................................817, 829, 838 portf.....................................817, 829, 838 portg ....................................817, 829, 838 program counter....................................... 73 program-counter relative ........................ 92 pwm modes........................................... 411 ramer ...................................812, 823, 834 rdr .................................552, 815, 827, 837 register addresses (in address order)..... 807 register bits............................................ 818 register configuration.............................. 71 register direct .......................................... 91 register field............................................ 89 register indirect........................................ 91 register indirect with displacement......... 91 register indirect with post-increment ...... 91 register indirect with pre-decrement....... 91 register information............................... 290 register states in each operating mode 830 repeat mode............................................. 295 reset ....................................................... 121 reset exception handling ...................... 122 rsr......................................................... 552 rstcsr ..........................472, 815, 826, 836 rxi ......................................................... 623 sar .285, 639, 808, 815, 818, 827, 830, 837 sarx...............................639, 815, 827, 837 sbycr ....................................809, 820, 831 scan mode .............................................. 698 sckcr ....................................810, 820, 831 scmr ..............................570, 815, 827, 837 scr..................................557, 815, 827, 837 scrx...............................643, 809, 819, 831 semr ..............................581, 810, 820, 831 serial communication interface ............. 547 serial format ............................................ 653 shift instructions....................................... 84 single mode............................................ 697 smart card .............................................. 547 smart card interface ............................... 610 smr................................ 553, 815, 826, 836 software activation .......................... 299, 303 ssr ................................. 563, 815, 827, 837 stack status............................................. 125 stack structure.................................... 66, 69 swdtend............................................. 299 synchronous mode ................................. 602 synchronous operation........................... 403 syscr............................ 105, 809, 820, 831 system control instructions...................... 88 tci1u ..................................................... 424 tci1v ..................................................... 424 tci2u ..................................................... 424 tci2v ..................................................... 424 tci3v ..................................................... 424 tci4u ..................................................... 424 tci4v ..................................................... 424 tci5u ..................................................... 424 tci5v ..................................................... 424 tcnt..............396, 468, 813, 815, 825, 826, ........................................................ 835, 836 tcora................................... 815, 826, 836 tcorb ................................... 815, 826, 836 tcr..........367, 813, 814, 824, 826, 835, 836 tcsr .............................. 468, 815, 826, 836 tdr ................................ 552, 815, 827, 837 tei .......................................................... 623 tgi0a..................................................... 424 tgi0b ..................................................... 424 tgi0c ..................................................... 424 tgi0d..................................................... 424 tgi0v..................................................... 424 tgi1a..................................................... 424 tgi1b ..................................................... 424 tgi2a..................................................... 424 tgi2b ..................................................... 424 tgi3a..................................................... 424
index rev. 5.00 aug 08, 2006 page 982 of 982 rej09b0054-0500 tgi3b ..................................................... 424 tgi3c ..................................................... 424 tgi3d..................................................... 424 tgi4a..................................................... 424 tgi4b ..................................................... 424 tgi5a..................................................... 424 tgi5b ..................................................... 424 tgr ................................ 396, 813, 825, 835 tier................................ 391, 813, 824, 835 tior ............................... 373, 813, 824, 835 tmdr............................. 372, 813, 824, 835 toggle output .................................. 401, 461 traces...................................................... 123 trap instruction....................................... 124 tsr ......................... 393, 553, 813, 825, 835 tstr............................... 396, 812, 822, 833 tsyr .............................. 397, 812, 822, 833 txi.......................................................... 623 vector number for the software activation interrupt .................................. 288 watchdog timer...................................... 465 watchdog timer mode ........................... 473 waveform output by compare match.... 400 wcrh..................................... 812, 823, 834 wcrl ..................................... 812, 823, 834 wovi...................................................... 476
renesas 16-bit single-chip microcomputer hardware manual h8s/2258, h8s/2239, h8s/2238, h8s/2237, h8s/2227 groups publication date: 1st edition, september, 2002 rev.5.00, august 08, 2006 published by: sales strategic planning div. renesas technology corp. edited by: customer support department global strategic communication div. renesas solutions corp. ? 2006. renesas technology corp. all rights reserved. printed in japan.
sales strategic planning div. nippon bldg., 2-6-2, ohte-machi, chiyoda-ku, tokyo 100-0004, japan http://www.renesas.com refer to " http://www.renesas.com/en/network " for the latest and detailed information. renesas technology america, inc. 450 holger way, san jose, ca 95134-1368, u.s.a tel: <1> (408) 382-7500, fax: <1> (408) 382-7501 renesas technology europe limited dukes meadow, millboard road, bourne end, buckinghamshire, sl8 5fh, u.k. tel: <44> (1628) 585-100, fax: <44> (1628) 585-900 renesas technology (shanghai) co., ltd. unit 204, 205, aziacenter, no.1233 lujiazui ring rd, pudong district, shanghai, china 200120 tel: <86> (21) 5877-1818, fax: <86> (21) 6887-7898 renesas technology hong kong ltd. 7th floor, north tower, world finance centre, harbour city, 1 canton road, tsimshatsui, kowloon, hong kong tel: <852> 2265-6688, fax: <852> 2730-6071 renesas technology taiwan co., ltd. 10th floor, no.99, fushing north road, taipei, taiwan tel: <886> (2) 2715-2888, fax: <886> (2) 2713-2999 renesas technology singapore pte. ltd. 1 harbour front avenue, #06-10, keppel bay tower, singapore 098632 tel: <65> 6213-0200, fax: <65> 6278-8001 renesas technology korea co., ltd. kukje center bldg. 18th fl., 191, 2-ka, hangang-ro, yongsan-ku, seoul 140-702, korea tel: <82> (2) 796-3115, fax: <82> (2) 796-2145 renesas technology malaysia sdn. bhd unit 906, block b, menara amcorp, amcorp trade centre, no.18, jalan persiaran barat, 46050 petaling jaya, selangor darul ehsan, malaysia tel: <603> 7955-9390, fax: <603> 7955-9510 renesas sales offices colophon 6.0
h8s/2258, h8s/2239, h8s/2238, h8s/2237, h8s/2227 groups hardware manual


▲Up To Search▲   

 
Price & Availability of HD6432256

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X